On Mon, 2011-05-30 at 18:36 -0400, Tom Horsley wrote:
Just for curiosity, why has no one ever arranged to log something like "Hey! I'm booting the system again!" as the very first line in that goes to /var/log/messages when the system is booting?
I used to do something like that back when I was still using another OS. I modified the bootup script to add my own entry at the beginning. You could do the same, I don't think the script gets changed by updates that often.
It is far easier to add: echo "Completed boot at `date`"
to the bottom of /etc/rc.d/rc.local
Then it does not matter whether the system is using the old method or systemd and whether it is writing to 'messages' or boot.log.
R. Geoffrey Newbury
On 05/31/2011 08:25 AM, R. G. Newbury wrote:
On Mon, 2011-05-30 at 18:36 -0400, Tom Horsley wrote:
Just for curiosity, why has no one ever arranged to log something like "Hey! I'm booting the system again!" as the very first line in that goes to /var/log/messages when the system is booting?
It does. There are several ways to find the top of the last boot. Assuming that you have rebooted since the last time /var/log/messages was rolled over, you can easily search for the top of the messages.
Here are a couple of guidelines:
First, the word ' Linux ', note the spaces, is not common in the logs, and always appears near the top of the boot sequence. Usually within the first 4 or 5 lines.
Second, no matter how fast your system reboots, the messages written at boot time will be written in a faster sequence than what was happening before the reboot, thus giving an obvious 'break' in the log time stamps at the beginning of a boot.
If you check more than a few times, you will notice that syslog itself reports the first line of boot, and you can search for that.
So in summary, if you see a syslog startup, followed within a few lines by the word ' Linux ', and what comes after that appear to be BIOS info, and that all these messages happen in the same second or two, you have found the top of the boot sequence.
Here is the top of my last boot:
... May 30 08:11:27 grok kernel: imklog 5.7.9, log source = /proc/kmsg started. May 30 08:11:27 grok rsyslogd: [origin software="rsyslogd" swVersion="5.7.9" x-pid="802" x-info="http://www.rsyslog.com"] start May 30 08:11:27 grok kernel: [ 0.000000] Initializing cgroup subsys cpuset May 30 08:11:27 grok kernel: [ 0.000000] Initializing cgroup subsys cpu May 30 08:11:27 grok kernel: [ 0.000000] Linux version 2.6.38.6-27.fc15.x86_64 (mockbuild@x86-03.phx2.fedoraproject.org) (gcc version 4.6.0 20110428 (Red Hat 4.6.0-6) (GCC) ) #1 SMP Sun May 15 17:23:28 UTC 2011 ...
Good Luck!
On Tue, 31 May 2011 10:17:56 -0600 Phil Meyer wrote:
So in summary, if you see a syslog startup, followed within a few lines by the word ' Linux ', and what comes after that appear to be BIOS info, and that all these messages happen in the same second or two, you have found the top of the boot sequence.
All of which make my point that it would sure be a lot simpler if there was merely a known string always printed at the top :-).
At one time I relied on timestamp gaps till I was trying to figure out the logs on a system where ntp was fighting with something else and the time kept wildly swinging on the running system.
On Tue, 2011-05-31 at 12:28 -0400, Tom Horsley wrote:
On Tue, 31 May 2011 10:17:56 -0600 Phil Meyer wrote:
So in summary, if you see a syslog startup, followed within a few lines by the word ' Linux ', and what comes after that appear to be BIOS info, and that all these messages happen in the same second or two, you have found the top of the boot sequence.
All of which make my point that it would sure be a lot simpler if there was merely a known string always printed at the top :-).
At one time I relied on timestamp gaps till I was trying to figure out the logs on a system where ntp was fighting with something else and the time kept wildly swinging on the running system.
Actually I think it would be simpler if each new boot simply started a new log file.
poc
On Tue, 2011-05-31 at 12:12 -0430, Patrick O'Callaghan wrote:
I think it would be simpler if each new boot simply started a new log file.
You mean like the old boot.log file, that was going to be improved, and was disabled in the meantime, then never was improved?
On Wed, 2011-06-01 at 11:51 +0930, Tim wrote:
On Tue, 2011-05-31 at 12:12 -0430, Patrick O'Callaghan wrote:
I think it would be simpler if each new boot simply started a new log file.
You mean like the old boot.log file, that was going to be improved, and was disabled in the meantime, then never was improved?
I don't remember that, but possibly.
poc
On Wed, 01 Jun 2011 11:51:18 +0930 Tim wrote:
You mean like the old boot.log file, that was going to be improved, and was disabled in the meantime, then never was improved?
Look again :-). All the changes to boot graphically brought with them one good feature - there is a boot.log file now.
On Wed, 2011-06-01 at 05:22 -0400, Tom Horsley wrote:
On Wed, 01 Jun 2011 11:51:18 +0930 Tim wrote:
You mean like the old boot.log file, that was going to be improved, and was disabled in the meantime, then never was improved?
Look again :-). All the changes to boot graphically brought with them one good feature - there is a boot.log file now.
Very nice (except for the embedded control codes), but not really what I meant. The idea was to have a new /var/log/messages file per boot (as an alternative to placing a marker in the file on reboot).
Of course a valid counter-argument is that the file could grow very large, which is why currently it's rolled over every week or so. Perhaps a boot marker would be better after all.
poc
At 07:40 on 01 Jun 2011, Patrick O'Callaghan wrote:
On Wed, 2011-06-01 at 05:22 -0400, Tom Horsley wrote:
On Wed, 01 Jun 2011 11:51:18 +0930 Tim wrote:
You mean like the old boot.log file, that was going to be improved, and was disabled in the meantime, then never was improved?
Look again :-). All the changes to boot graphically brought with them one good feature - there is a boot.log file now.
Very nice (except for the embedded control codes), but not really what I meant.
less -r /var/log/boot.log
On Wed, 2011-06-01 at 14:47 +0100, Mark Knoop wrote:
At 07:40 on 01 Jun 2011, Patrick O'Callaghan wrote:
On Wed, 2011-06-01 at 05:22 -0400, Tom Horsley wrote:
On Wed, 01 Jun 2011 11:51:18 +0930 Tim wrote:
You mean like the old boot.log file, that was going to be improved, and was disabled in the meantime, then never was improved?
Look again :-). All the changes to boot graphically brought with them one good feature - there is a boot.log file now.
Very nice (except for the embedded control codes), but not really what I meant.
less -r /var/log/boot.log
Kewl :-)
poc
On 05/31/2011 07:25 AM, R. G. Newbury wrote:
It is far easier to add: echo "Completed boot at `date`"
to the bottom of /etc/rc.d/rc.local
Then it does not matter whether the system is using the old method or systemd and whether it is writing to 'messages' or boot.log.
The whole point of this is to show where the boot starts, not ends.