logd (8) - Linux Manuals

logd: job output logging daemon


logd - job output logging daemon


logd [OPTION]...


logd is started by init(8) to receive the output of jobs with console logged in their job definition, which is the default if no other console setting is given.

Output is timestamped and written, with the job name, to /var/log/boot or stored in memory until the file is writable.


Detaches from the terminal and runs in the background.


To eliminate race conditions on startup, such as not being ready to receive connections when the first job is started, the following procedure is used.

Once ready to receive connections, logd raises the SIGSTOP signal, putting itself to sleep until continued by another process.

After starting logd, init(8) waits for the process to stop if it hasn't already, and then sends it the SIGCONT signal so that it can proceed. Only once this has happened, will init(8) start other jobs.

When the --daemon option is given, this is not performed; instead logd will not detach from the console until it is listening on the socket.


logd listens on a unix(7) stream socket in the abstract namespace, bound to /com/ubuntu/upstart/logd.

init(8) opens a new connection for each job that is to be logged, binding the socket to the standard input, output and error file descriptors for the job.

Before running the job, it sends the job name on the socket so that it can be logged along with the messages. This is sent as a size_t that contains the length of the name to read, followed by that many character bytes. The NULL terminator is not sent as part of the protocol, it is up to the receiver to add that if required.

Further information about the job, such as its description, can be obtained by opening an ordinary connection to the init(8) daemon and querying it using the name received.


Written by Scott James Remnant.


Report bugs at https://launchpad.net/products/upstart/+bugs


Copyright © 2006 Canonical Ltd.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.