How to make a persistant debug output?

Asked by Roland Wolters

I have no idea how to tell upstart to write to any log file so that I can check afterwards what went wrong.
I know about the --debug kernel option, but the debug is only on the screen and nowhere else in any logfile.

I asked at the wiki page of upstart, http://upstart.ubuntu.com/wiki/Debugging , I also asked at the E-Mail list, but I got no answer whatsoever anywhere.
Is it possible at all to make such a log? If not I will create a wish-bug report.

Question information

Language:
English Edit question
Status:
Solved
For:
upstart Edit question
Assignee:
No assignee Edit question
Solved by:
Scott James Remnant (Canonical)
Solved:
Last query:
Last reply:
Revision history for this message
Best Scott James Remnant (Canonical) (canonical-scott) said :
#1

There isn't a generic answer to this.

You can't write the debug output directly since you won't have a writable filesystem when upstart starts, since part of its job is to mount the filesystem.

Also upstart reopens the console on startup, so redirecting the file descriptors won't work either.

The easiest way is to include some kind of syslog utility in the initramfs, so it is started before init, and configure that to write to an available writable filesystem (/dev is usually a favourite)

Revision history for this message
Roland Wolters (wolters-liste) said :
#2

Thanks Scott James Remnant, that solved my question.

Revision history for this message
SaintDanBert (saint-grillongroup) said :
#3

Can we agree to the convention to write persistent debug, log-type output to some standard name like /dev/upstart/somefile?
Does this make some sort of sense?

Can we get some sort of scaffolding to accomplish this -- some sort of LOG_EVENT or similar -- along with some helper statements within job files?

    <job>
    ....
    LOG_THIS blah blah
    ...