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.
man lastin terminal and you will get all information you need to parse/var/log/wtmp. Commandlastwill translate binary information into human readable content. – jlandercy Feb 24 '14 at 18:26