2

How do i find out if the system is halting by its self, or a user via terminal?

I took this from the /var/log/user.log logged in as root via ssh:

Feb 20 21:07:40 raspberrypi shutdown[3405]: shutting down for system halt

the /var/log/syslog has exactly the same entry.

Steve Robillard
  • 34,687
  • 17
  • 103
  • 109
reggie
  • 1,121
  • 4
  • 14
  • 30

1 Answers1

1

You will find useful informations /var/log/messages. Further valuable informations on logged in/out users, services and reboots are available in /var/log/wtmp which must be parsed by last command to be human readable (see man last for details).

jlandercy
  • 446
  • 2
  • 9
  • I'm new to linux, so please explain how to read the /var/log/wtmp. I tried to open it in a text editor, but ...! – reggie Feb 24 '14 at 17:55
  • As suggested in my answer, issue man last in terminal and you will get all information you need to parse /var/log/wtmp. Command last will translate binary information into human readable content. – jlandercy Feb 24 '14 at 18:26
  • thanks the last command was just what i was looking for! – reggie Feb 24 '14 at 23:05