Search code examples
loggingcentosredhatshutdownreboot

CentOS- I would like to know how can I see when the system is shutting down?


I had the following question in a test:

"Each time that the system is order to shut down, register the following message -System stopped at hh:mm:ss from dd/mm/yyyy-, at /root/log_stop"

the question is that, I would really like how can I know that :D

thank you very much.


Solution

  • I think this might be an answer:

    --->edit /etc/rsyslog.conf

    in the global directives we can establish the format (I'd like to know how can I create my own template, that would be another question), once we have the template desired in rules I can redirect the messages from any daemon trough that file, which daemon can I redirect? this ones:

    kern user mail daemon aut syslog syslogd lpr cron local0-7

    if you need more info check the manual entry for /etc/rsyslog.conf

    PS: I'm still not sure this is the answer, I think it MIGHT be one answer, can anyone help me? :D