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 |
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. :) |
Quote:
I'm trying to discover what Upstart wants instead. ~~~ 0;-Dan |
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 |
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.
|
Quote:
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 |
... more about UPSTART
Quote:
-- much like "it's 5 o'clock somewhere" (grin) Quote:
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 |
All times are GMT -5. The time now is 05:49 PM. |