Skip to content

Commit

Permalink
Collect kernel logs of last 3 boots
Browse files Browse the repository at this point in the history
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
  • Loading branch information
bk201 committed Sep 1, 2022
1 parent 448b4e0 commit 0c5114c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hack/collector-harvester
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ mkdir -p logs
cd logs

chroot $HOST_PATH /usr/bin/journalctl -k > kernel.log
# also collect logs of previous two boots
for ((i=1; i<=2; i++)); do
log_name="kernel.log.$i"
chroot $HOST_PATH /usr/bin/journalctl -k -b $((-i)) > $log_name
[ ! -s $log_name ] && rm -f $log_name
done

units=(rke2-server rke2-agent rancherd rancher-system-agent wicked iscsid)

Expand Down

0 comments on commit 0c5114c

Please sign in to comment.