LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-20-2014, 01:13 PM   #1
rpascua
LQ Newbie
 
Registered: Dec 2011
Location: USA
Distribution: RHEL5, RHEL6, CentOS
Posts: 8

Rep: Reputation: Disabled
Cool Listing of last logged in users (last command)


After running "uptime" command I discovered that my server rebooted a few days ago. I'm trying to find out who did it by running a "last" command. But the result is rather confusing for me. Normally the output gives you a bunch of lines that looks similar to this:

<user> pts/3...........<server>.....Mon Feb 24 13:04 - 15:05 (1+02:00)

However, one of the output, which is the actual date and time that the reboot is suspected to have happen, shows this:

reboot system boot 2.6.18-371.1.2.el5 Fri Mar 14 12:30 (5+06:20)

Does the output above mean that the system rebooted by itself? How come there's no username and server name associated with that reboot? Any assistance would be much appreciated.
 
Old 03-20-2014, 01:28 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
reboot means the system came up at that time. The line is logged by pseudo-user "reboot". last has no idea what caused the system to go down. The lines just before reboot tell you who was logged in at the time, but nothing can tell you if someone pulled the plug out and then restarted the system, for example.
 
Old 03-20-2014, 11:48 PM   #3
ilesterg
Member
 
Registered: Jul 2012
Distribution: CentOS, SLES, RHEL, HP-UX, OpenSUSE Tumbleweed KDE
Posts: 504

Rep: Reputation: 54
Okay, so, how do we then determine why a certain server shutdown? I believe /var/log/messages logs the boot up and shutdown of a system. If there are messages indicating the bootup but no shutdown before it, could we assume that the shutdown was caused by things like power outages?

Cheers!
 
Old 03-21-2014, 01:51 AM   #4
xenner
Member
 
Registered: Jul 2009
Location: Brisbane
Distribution: RHEL 6.5
Posts: 39

Rep: Reputation: 0
Hi,

Can you not do:
Code:
grep -ri "init 6" /home*
Or grep for "shutdown" or "reboot"... Look in the .bash_history.

Xen.
 
Old 03-21-2014, 02:31 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
As smallpond indicated, use the 'reboot' timestamp as a guide and investigate the logfiles for recs immediately before that and check who was logged on at the time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sftp ls command, short listing vs long listing slufoot80 Linux - General 3 02-05-2013 11:40 AM
Bash command to list users logged in at 5pm F4U57 Linux - Newbie 2 06-07-2010 11:37 PM
Logged in users xlordt Linux - Newbie 3 11-01-2007 11:54 PM
4 of the same users logged on... true_atlantis Linux - Newbie 1 04-14-2006 12:54 AM
No Users logged in X kaise_sose Linux - Software 2 10-19-2004 03:57 AM


All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration