LinuxQuestions.org
Review your favorite Linux distribution.
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, 12: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, 12:28 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,137

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
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, 10:48 PM   #3
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
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, 12: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, 01:31 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,349

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
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 10:40 AM
Bash command to list users logged in at 5pm F4U57 Linux - Newbie 2 06-07-2010 10:37 PM
Logged in users xlordt Linux - Newbie 3 11-01-2007 10:54 PM
4 of the same users logged on... true_atlantis Linux - Newbie 1 04-13-2006 11:54 PM
No Users logged in X kaise_sose Linux - Software 2 10-19-2004 02:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:05 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
Open Source Consulting | Domain Registration