LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-28-2018, 08:03 PM   #16
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,185

Rep: Reputation: 662Reputation: 662Reputation: 662Reputation: 662Reputation: 662Reputation: 662

Quote:
Originally Posted by scasey View Post
I've highlighted the last two boots of the server.
Is that not what you're asking?
On _my_ system
Code:
$ last reboot
will give them without other info and
Code:
$ uptime
will tell you how long you've been up since the last reboot.

As I cleanup the last database (/var/log/lastlog) every month, last will only give me the info from this month, but your lastlog may go back further.
 
1 members found this post helpful.
Old 12-28-2018, 08:29 PM   #17
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,376

Rep: Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551
Quote:
Originally Posted by ehartman View Post
On _my_ system
Code:
$ last reboot
will give them without other info and
Code:
$ uptime
will tell you how long you've been up since the last reboot.
Very cool! Thank you! That definitely looks like the answer to the OP's question!
Quote:
Originally Posted by ehartman View Post
As I cleanup the last database (/var/log/lastlog) every month, last will only give me the info from this month, but your lastlog may go back further.
Mine goes back to Tue Sep 19 16:24:49 2017, which is when I brought this server on-line.
 
Old 12-29-2018, 05:03 PM   #18
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-17.3 with Cinnamon & KDE
Posts: 1,679

Original Poster
Blog Entries: 3

Rep: Reputation: 105Reputation: 105
Quote:
Originally Posted by pan64 View Post
see post #2. Did you try the command last ?
While 'last' does show me the date-time of the most recent boot, and since I can use that date-time to search any log for entries around that time, I am looking for a log file entry that is definitive "system boot starts here".

Thank you for your replies,
~~~ 0;-Dan
 
Old 12-29-2018, 05:08 PM   #19
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,376

Rep: Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551
Quote:
Originally Posted by SaintDanBert View Post
While 'last' does show me the date-time of the most recent boot, and since I can use that date-time to search any log for entries around that time, I am looking for a log file entry that is definitive "system boot starts here".

Thank you for your replies,
~~~ 0;-Dan
What you see from the last command is the ‘definitive "system boot starts here".’
 
Old 12-29-2018, 08:34 PM   #20
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,185

Rep: Reputation: 662Reputation: 662Reputation: 662Reputation: 662Reputation: 662Reputation: 662
Quote:
Originally Posted by SaintDanBert View Post
I am looking for a log file entry that is definitive "system boot starts here".
There isn't one because just after system boot logging is still disabled and the root fs mounted read-only.
As every distro has different startup handling the first entry AFTER the reboot is the one that came in just after system logging was enabled, the messages between the end of dmesg (which are in kernel memory, not disk) and that point never are logged (onto disk files).
So the first entry is distribution, kernel and startup method dependent.
Even the message in lastlog isn't WRITTEN on disk until the root fs has been remounted read-write. so after the file system check etc was done before that.
So by looking in the logs to lines after the date/time reported by last reboot you can determine what on YOUR system is the first logged entry.
 
1 members found this post helpful.
Old 12-30-2018, 04:01 AM   #21
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,603

Rep: Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361Reputation: 4361
the first message in /var/log/messages (this is my debian) is:
Code:
<date> <time> <host> kernel: [    0.000000] Linux version 4.9.0-8-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 SMP Debian 4.9.130-2 (2018-10-27)
but as it was mentioned it depends on the distro and probably even the file /var/log/messages is missing.
 
  


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
How to log internal-sftp chroot jailed users access log to /var/log/sftp.log file LittleMaster Linux - Server 0 09-04-2018 04:45 PM
[SOLVED] Won't boot: /etc/rc.d/init.d/rc: line 193: /var/log/boot.log: Read-only file system liquidkaleidoscopes Linux From Scratch 6 11-11-2011 09:53 PM
Multi-disk, multi-boot system does not boot after fresh install anth0ny5 Linux - Software 8 08-17-2011 03:02 AM
[SOLVED] /var/log/boot.log is empty in RHEL5.5. How to enable the boot log? rajivdp Linux - Newbie 1 08-12-2010 09:11 AM
fresh install (fresh headache) powadha Slackware 2 03-06-2004 02:03 PM

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

All times are GMT -5. The time now is 07:24 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