Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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).
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.
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.
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.
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)
"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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.