[Dnsmasq-discuss] logging to stderr

clemens fischer ino-news at spotteswoode.dnsalias.org
Fri May 7 15:43:09 BST 2010


Simon Kelley wrote:

> Would it be possible to use a named pipe as the target for
> --log-facility, and read from that?

No:  supervisors like "runit" and the original supervise manage the
pipes connecting the producer and the consumer themselves.  This makes
it possible to restart either of them without loosing any data, also,
log rotation and compression rely on it, for the same reason.

Nevertheless this is the way logging is done when the producer cannot be
persuaded into using an fd.  For example, an adaptor process called
"socklog" is used to substitute for syslog:  it reads /dev/log and sends
output to stderr, where the actual logger "svlogd" does its regular job.
This adaptor does things like decoding facility/severity.

I could use something like "socklog ucspi < [named-pipe]" as the
producer, but then I loose some benefits from the runit supervisor:  it
cannot see if dnsmasq crashes and with what exit-code.  Normally I can
have runit check if dnsmasq is healthy and either restart or disable it
depending on exit-code while keeping the logger process running and
catch the messages.


regards, clemens




More information about the Dnsmasq-discuss mailing list