Remind me on Monday to post a script I use.<div><br></div><div>It parses the kmsg log, and the output from D-Bus initctl calls, and generates a giant dotty chart of the boot sequence - not just based on configuration but on what actually caused what<br>
<br><div class="gmail_quote">On Fri, Jun 17, 2011 at 1:09 PM, James Hunt <span dir="ltr"><<a href="mailto:james.hunt@canonical.com">james.hunt@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi All,<br>
<br>
I'd like to get some discussion going about the logging of events and jobs in Upstart.<br>
<br>
Scott has done some great work recently wrt the kmsg change [1] such that you can now see everything<br>
from the "startup" event onwards if you boot with --debug/--verbose and configure your syslog daemon<br>
appropriately.<br>
<br>
The ability to have a log of all Upstart events is invaluable, particularly for servers which have<br>
been up for aeons as it helps users and admins learn more about their own particular set of event flows.<br>
<br>
I'm wondering therefore if it is worth taking the logging a step further by considering one of the<br>
following (or any other ideas readers have of course):<br>
<br>
1) Making Upstart default to logging event/job state messages.<br>
<br>
   We might need to change some of the formatting a little to make it more palatable to admins, but<br>
the work is essentially already done.<br>
<br>
2) Have Upstart store a log of event+job details *internally*.<br>
<br>
I'm not suggesting we necessarily do this, but I think it's an interesting idea so I'd like to share<br>
it...<br>
<br>
The thought is that we introduce a new configure option (default disabled) which if enabled would<br>
make upstart store internally the name/env/exit status? (and maybe some sort of timestamp) for every<br>
event and job it runs.<br>
<br>
The problem with this is:<br>
<br>
- - the data isn't viewable anywhere.<br>
- - assuming a linear log [2], more and more memory is being consumed (a bad thing for init generally)<br>
<br>
The solution to this is 2 new initctl commands:<br>
<br>
        initctl show-internal-log<br>
<br>
This command would write the internal log to stdout. However, if you ran it like this...<br>
<br>
        initctl clear-internal-log<br>
<br>
This would make init free its internal log.<br>
<br>
Now, as long as clear-internal-log is called at some "reasonable" point in the boot, we have the<br>
ability to see exactly what events were emitted and what jobs were run, the relative order and we<br>
stop init gobbling up ever increasing amounts of memory.<br>
<br>
Comments?<br>
<br>
Kind regards,<br>
<br>
James.<br>
<br>
[1] - <a href="https://lists.ubuntu.com/archives/upstart-devel/2011-February/001409.html" target="_blank">https://lists.ubuntu.com/archives/upstart-devel/2011-February/001409.html</a><br>
[2] - we could of course consider a circular log.<br>
<br>
- --<br>
James Hunt<br>
____________________________________<br>
Ubuntu Foundations Team, Canonical.<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iEYEARECAAYFAk37tIkACgkQYBWEaHcQG9dkSgCfQMkoUw2VjIRjVXAH7xJdXUAt<br>
udcAnjNtyX0SNY0N2sh6hRU8U/2X1k7g<br>
=vk6z<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br></div>