Hi,
KatolaZ writes:
> On Tue, Oct 23, 2018 at 12:32:54PM -0400, Steve Litt wrote:
>
> [cut]
>
>> Ahh, the preceding explains why G. Pape says runit level logs are
>> required on *some* daemons, but not others. If the daemon already
>> performs meaningful syslog() calls, there's no reason for further
>> logging. The logger program is needed only for those daemons not
>> already doing syslog() calls. The set of programs not doing syslog
>> calls includes all my home-grown daemons: Being a longtime daemontools
>> guy, I just write warnings and errors to stderr and know
>> daemontools/runit/s6/perp will get them into the logs.
>
> That's was exactly the aim of my previous question :)
>
>> So Didier: I amend my question to this: Is logger the best log
>> mechanism to get stderr into the logs, for daemons not doing their own
>> syslog() calls?
>>
>> [...]
>
> The fact that some daemons do not use a custom log does not mean that
> they are not logging to syslog (notable examples include cron,
> dhclient, sshd, and many other).
>
> If a daemon is not doing its syslog proper calls, redirecting the
> stdout and stderr to logger could make sense (but a deamon is normally
> expected to close stdout and stderr as soon as it is spawned, and use
> syslog() calls for logging...).
Redirecting to logger is probably the most portable solution as it does
not make any assumptions as to which system-log-daemon is used.
On my system I get
$ apt-cache search system-log-daemon
busybox-syslogd - Provides syslogd and klogd using busybox
inetutils-syslogd - system logging daemon
rsyslog - reliable system and kernel logging daemon
syslog-ng-core - Enhanced system logging daemon (core)
Of these, rsyslog is installed by default, at least on ascii. If you
could assume rsyslog is always installed, binding the daemon's stdout
and stderr to /dev/log would work fine too.
Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join