LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-07-2010, 12:34 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
seeking "first log entry" during a reboot


Under Ubuntu Lucid, the "upstart" style gets used during system startup.
How do I discover the absolute first log entry (syslog or messages) that happens after a restart.

As I look at the logs, it seems that the "first message" varies quite a bit. I hope that there is a better way to look at things.

I hope, too, that when the kernel launches upstart (/sbin/init?) there is some always present log entry that announces a system startup.

Merci d'avance,
~~~ 0;-Dan
 
Old 09-07-2010, 12:41 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
On RHEL systems, I normally just open /var/log/messages with the less(1) pager, jump to the bottom ("G"), and then search backwards for restart ("/restart", followed by "N").

This isn't perfect, but it usually works, because syslogd doesn't get restarted very often under normal circumstances. If you need something more precise (i.e. for the purposes of a script that parses the log out) you might want to create your own init script and have it put something obvious in the kern (or whatever facility) messages using logger(1).

YMMV with Ubuntu.
 
Old 09-07-2010, 04:25 PM   #3
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by anomie View Post
On RHEL systems, I normally just open /var/log/messages with the less(1) pager, jump to the bottom ("G"), and then search backwards for restart ("/restart", followed by "N").

This isn't perfect, but it usually works, because syslogd doesn't get restarted very often under normal circumstances. If you need something more precise (i.e. for the purposes of a script that parses the log out) you might want to create your own init script and have it put something obvious in the kern (or whatever facility) messages using logger(1).

YMMV with Ubuntu.
Under sysVinit, I'd added something to /etc/rc.local or an /etc/rcX.d/S00something script.

I'm trying to discover what Upstart wants instead.

~~~ 0;-Dan
 
Old 09-07-2010, 05:48 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Fair enough - so my RHEL analogy is probably irrelevant.

If I were tasked with what you're trying to do, I would start here:
http://upstart.ubuntu.com/getting-started.html
 
1 members found this post helpful.
Old 09-07-2010, 07:21 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
The first message after a reboot will be from the kernel, and since it is at boot time 0, it will contain "[ 0.000000]" on systems (like Ubuntu) that tag the kernel messages with a time. So that should give you a good starting point.
 
1 members found this post helpful.
Old 09-08-2010, 02:09 PM   #6
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by Matir View Post
The first message after a reboot will be from the kernel, and since it is at boot time 0, it will contain "[ 0.000000]" on systems (like Ubuntu) that tag the kernel messages with a time. So that should give you a good starting point.
That is a great clue... THANKS!

I have my shutdown scripts accomplish a logrotate so that each operator requested reboot gets a mostly fresh log. If there is more than one 'restart' in a log, I'll know it was unscheduled or unrequested.

Merci, d'avance,
~~~ 0;-Dan
 
Old 09-08-2010, 02:14 PM   #7
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
... more about UPSTART

Quote:
Originally Posted by anomie View Post
Fair enough - so my RHEL analogy is probably irrelevant.
While they may not be useful to me, they are likely useful to someone else. I've learned that well intentioned answers have value somwhere.
-- much like "it's 5 o'clock somewhere" (grin)

Quote:
Originally Posted by anomie View Post
If I were tasked with what you're trying to do, I would start here:
http://upstart.ubuntu.com/getting-started.html
"Upstart" responds to events.
Q1: Where do these events come from? Does each driver (kernel module) have responsibility to throw relevant events? Is there an API or SPI for said event throwing?

Q2: Where do I read about boot-time event creation and any API or SPI?

Merci d'avance,
~~~ 0;-Dan
 
  


Reply



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
seeking conversion to/from winXX tablet "journal" and X11 tablet "xournal" ink SaintDanBert Linux - Software 0 01-12-2010 05:14 PM
Seeking for "Synchronise" and "patients" projects/scripts of Visual Basic LAN-Dominator.nl Programming 2 07-05-2008 07:21 PM
No UTMPX entry, You must EXEC "login" for the lowest "shell" ooihc Solaris / OpenSolaris 7 03-12-2007 02:09 PM
New SQUID user: How to clear the "access.log" and "store.log" automatically? yuzuohong Linux - Networking 2 12-02-2006 05:37 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:48 PM.

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