:: Re: [DNG] Everyone OK for using the…
Góra strony
Delete this message
Reply to this message
Autor: KatolaZ
Data:  
Dla: dng
Temat: Re: [DNG] Everyone OK for using the logger program for runit logging?
On Wed, Oct 24, 2018 at 08:34:19PM +0900, Olaf Meeuwissen wrote:

[cut]

> >
> > 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.
>


Which system-log-daemon is being used is literally irrelevant: if a
program logs messages using the syslog() function, which is how you
log to the system logger from a program, those messages get managed by
whichever system logger is currently handling them (i.e., by reading
from /dev/log and other configurable places, and putting them in a
logfile or sending them across the network to a syslog-daemon
somewhere else).

The syslog() function is standard (it is specified in POSIX-1,
POSIX-2, and SUSv2), and exists in any POSIX-compliant operating
system.

And no, redirecting to `logger` is just a workaround for a daemon that
does not work as a daemon is supposed to work (i.e., close
stdout/stderr and log using the syslog() system call). Nevertheless,
it is useful for scripts that are not exactly daemons, like those who
check for some service/facility to be available.

My2Cents

KatolaZ

-- 
[ ~.,_  Enzo Nicosia aka KatolaZ - Devuan -- Freaknet Medialab  ]  
[     "+.  katolaz [at] freaknet.org --- katolaz [at] yahoo.it  ]
[       @)   http://kalos.mine.nu ---  Devuan GNU + Linux User  ]
[     @@)  http://maths.qmul.ac.uk/~vnicosia --  GPG: 0B5F062F  ] 
[ (@@@)  Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ  ]