![]() We use head to keep the latest 10 events and we use tac to invert the ordering so that we don't get confused by the fact that last prints from most recent to least recent event. The special users reboot and shutdown log in when the system reboots Records are printed from most recent to least recent. *: Here's the description of last from its man page: last prints information about connect times of users. If you have a UPS and running a daemon to monitor power and shutdown you should obviously check its logs (NUT logs on /var/log/messages but apcupsd logs on /var/log/apcupsd*) When the system shuts down due to overheating you get logs like this: critical temperature reached.,shutting down Only when the system shuts down orderly you get logs like this: rsyslogd. When the system powers off because user pressed the power button you get logs like this: systemd-logind: Power key pressed. Systemd-journald: File /var/log/journal/./system.journal corrupted or uncleanly shut down, renaming and replacing. When an unexpected power off or hardware failure occurs the filesystems will not be properly unmounted so in the next boot you may get logs like this: EXT4-fs. *: Power Button\|watching system buttons\|Stopped Cleaning Up\|Started Crash recovery kernel' \ Sun Jun 17 15:40 - 09:51 (18:11)Ī bash command to filter the most interesting log messages is this: grep -iv ': starting\|kernel. <- then we've a boot WITHOUT a prior shutdown <- the system was running since this momemnt Fri Aug 10 15:58 - 15:32 (2+23:34)Īn unexpected shutdown from power loss looks like this (note that you have a system boot event without a prior system shutdown event): runlevel (to lvl 3). <- first the system shuts down (init level 0) In some cases you may see this (note that there is no line about the shutdown but the system was at runlevel 0 which is the "halt state"): runlevel (to lvl 0). ![]() Run this command* and compare the output to the examples below: last -x | head | tacĪ normal shutdown and power-up looks like this (note that you have a shutdown event and then a system boot event): runlevel (to lvl 0) 2.6.32- Sat Mar 17 08:48 - 08:51 (00:02) ![]() | grep -iw 'recover*\|power*\|shut*down\|rsyslogd\|ups'ġ) Regarding the output of last -x command var/log/messages /var/log/syslog /var/log/apcupsd* \ Use these 2 commands and keep reading for more information.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |