Re: mutilog via fifo

Daryl Tester <[email protected]> Sat, 02 Aug 2008 13:56:29 +0930
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
richard lucassen wrote:

> then multilog only receives the tcpserver messages. As a workaround for
> this I can write to a fifo and let multilog pick it up:
> 
> # cat run
> #!/bin/sh
> exec 2>&1
> exec /usr/local/bin/setuidgid nobody /usr/local/bin/tcpserver -vDRHl0 \
> -c100 0 8088 /usr/local/bin/elhttp 0 0.0.0.0 0.0.0.0 \
> "/usr/local/elhttp/fifo" 1

The only problem with this method is that the messages that were going
to stdout and stderr (e.g. from tcpserver) are now going elsewhere -
depending on how you invoked svscan this might be readproctitle,
or just dumped into the ether.

> Is this a good solution or is this a dirty way to log to multilog?

It's a solution.  Typically when I've found myself in similar situations
I've modified the original program to spit out the logs to stdout/stderr,
sans timestamps (which typically have to be removed as well - I figure
in for a penny, in for a pound).  I think smartmon was the last program
I had to do this for, as it switched on buffering on its stdout (causing
the log messages to batch up).

Cheers,
  --dt