CentOS Reboot

nmameer2021

New Member
Joined
Nov 4, 2021
Messages
4
Reaction score
0
Credits
54
How do we identify if the restart of a CENTOS was graceful or abrupt.

The command I believe shutdown -r now is a command which will reboot a linux machine gracefully ?
 


The two commands to use in a terminal are
Code:
 shutdown -r   reboot
and
 shutdown -H  Halt/shutdown
 
How do we identify if the restart of a CENTOS was graceful or abrupt.

last -x

might show what you are looking for. Sometimes you have to do some detective work in dmesg or /var/log/messages
 
last -x

might show what you are looking for. Sometimes you have to do some detective work in dmesg or /var/log/messages


Thanks for your feedback. However, the above provides the below output which is great.

However how do we identify if system was rebooted using a proper reboot or was it due to some live migration on hyper-v / power outage. I have put a real time issue which I am facing and looking for your assistance. Digging message in /var/log/messages is ideal when the issue is recent. In some case the application teams come back to us very later and these messages would have also be moved to messages2021xxxx

Is there any simple way to identify the list of reboots and the mechanism of the reboots.

_____________________________________________________________
root pts/0 172.25.208.1 Fri Nov 5 09:57 still logged in
root tty1 Fri Nov 5 09:55 - 09:57 (00:01)
runlevel (to lvl 3) 3.10.0-693.el7.x Fri Nov 5 09:55 - 09:57 (00:02)
reboot system boot 3.10.0-693.el7.x Fri Nov 5 09:55 - 09:57 (00:02)
root tty1 Fri Nov 5 09:26 - 09:55 (00:28)
runlevel (to lvl 3) 3.10.0-693.el7.x Fri Nov 5 09:26 - 09:55 (00:29)
reboot system boot 3.10.0-693.el7.x Fri Nov 5 09:26 - 09:57 (00:31)
root tty1 Thu Nov 4 16:06 - 16:07 (00:00)
runlevel (to lvl 3) 3.10.0-693.el7.x Thu Nov 4 16:05 - 09:26 (17:20)
reboot system boot 3.10.0-693.el7.x Thu Nov 4 16:05 - 09:57 (17:52)
root pts/0 172.25.208.1 Thu Nov 4 15:54 - 15:55 (00:01)
runlevel (to lvl 3) 3.10.0-693.el7.x Thu Nov 4 15:52 - 16:05 (00:12)
reboot system boot 3.10.0-693.el7.x Thu Nov 4 15:52 - 09:57 (18:04)
shutdown system down 3.10.0-693.el7.x Thu Nov 4 15:52 - 15:52 (00:00)
root pts/0 172.25.208.1 Thu Nov 4 15:51 - down (00:01)
root tty1 Thu Nov 4 15:50 - 15:50 (00:00)
runlevel (to lvl 3) 3.10.0-693.el7.x Thu Nov 4 15:49 - 15:52 (00:02)
reboot system boot 3.10.0-693.el7.x Thu Nov 4 15:49 - 15:52 (00:02)
root pts/0 172.25.208.1 Thu Nov 4 13:21 - crash (02:28)
root pts/0 172.25.208.1 Thu Nov 4 11:05 - 13:20 (02:14)
___________________________________________________________________________________
Real Time Issue

There are 3 Linux administrators, we all use the root login (understood we need to create separate login credentials which we are planning to implement as a lesson learnt) So the reboot has taken place on Nov 3. The linux administrators are telling they have not rebooted the server. We can see from the logs /var/log/messages that there was a reboot occurred. However why did this happen is unclear, meaning are these 3 administrators telling the truth and it had rebooted by itself for some reason ? is what we want to find.
 
Thanks for your feedback. However, the above provides the below output which is great.

However how do we identify if system was rebooted using a proper reboot or was it due to some live migration on hyper-v / power outage. I have put a real time issue which I am facing and looking for your assistance. Digging message in /var/log/messages is ideal when the issue is recent. In some case the application teams come back to us very later and these messages would have also be moved to messages2021xxxx

Is there any simple way to identify the list of reboots and the mechanism of the reboots.

_____________________________________________________________
root pts/0 172.25.208.1 Fri Nov 5 09:57 still logged in
root tty1 Fri Nov 5 09:55 - 09:57 (00:01)
runlevel (to lvl 3) 3.10.0-693.el7.x Fri Nov 5 09:55 - 09:57 (00:02)
reboot system boot 3.10.0-693.el7.x Fri Nov 5 09:55 - 09:57 (00:02)
root tty1 Fri Nov 5 09:26 - 09:55 (00:28)
runlevel (to lvl 3) 3.10.0-693.el7.x Fri Nov 5 09:26 - 09:55 (00:29)
reboot system boot 3.10.0-693.el7.x Fri Nov 5 09:26 - 09:57 (00:31)
root tty1 Thu Nov 4 16:06 - 16:07 (00:00)
runlevel (to lvl 3) 3.10.0-693.el7.x Thu Nov 4 16:05 - 09:26 (17:20)
reboot system boot 3.10.0-693.el7.x Thu Nov 4 16:05 - 09:57 (17:52)
root pts/0 172.25.208.1 Thu Nov 4 15:54 - 15:55 (00:01)
runlevel (to lvl 3) 3.10.0-693.el7.x Thu Nov 4 15:52 - 16:05 (00:12)
reboot system boot 3.10.0-693.el7.x Thu Nov 4 15:52 - 09:57 (18:04)
shutdown system down 3.10.0-693.el7.x Thu Nov 4 15:52 - 15:52 (00:00)
root pts/0 172.25.208.1 Thu Nov 4 15:51 - down (00:01)
root tty1 Thu Nov 4 15:50 - 15:50 (00:00)
runlevel (to lvl 3) 3.10.0-693.el7.x Thu Nov 4 15:49 - 15:52 (00:02)
reboot system boot 3.10.0-693.el7.x Thu Nov 4 15:49 - 15:52 (00:02)
root pts/0 172.25.208.1 Thu Nov 4 13:21 - crash (02:28)
root pts/0 172.25.208.1 Thu Nov 4 11:05 - 13:20 (02:14)
___________________________________________________________________________________
Real Time Issue

There are 3 Linux administrators, we all use the root login (understood we need to create separate login credentials which we are planning to implement as a lesson learnt) So the reboot has taken place on Nov 3. The linux administrators are telling they have not rebooted the server. We can see from the logs /var/log/messages that there was a reboot occurred. However why did this happen is unclear, meaning are these 3 administrators telling the truth and it had rebooted by itself for some reason ? is what we want to find.

Dear Community,

Appreciate your input in the above please.
 

Members online


Latest posts

Top