On Wed, 23 Nov 2022 18:42:19 +0100 Andras Korn
<korn-debb...@elan.rulez.org> wrote:

> How about you make default-syslog/check use socklog-check or
> unixclient if they are available, and fall back to the current
> heuristics if not? Something like this:
> 
> #!/bin/sh
> 
> # note: only socklog exists as runit service in Debian right now
> 
> socklog-check && exit 0
> 
> unixclient /dev/log /bin/true 2>&1 | grep -q '^connect: Protocol
> wrong type for socket' && exit 0
> 
> fuser /dev/log >/dev/null 2>/dev/null && exit 0
> 
> for service in rsyslog socklog socklog-unix syslog-ng busybox-syslogd
> inetutils-syslogd ; do sv u $service && sv check $service && exit 0
> done
> 
> exit 1
> 
> If socklog-check and unixclient aren't installed, those commands will
> just fail and the script will fall back to the next attempt.
> 
> The only way I can see this being worse than the current solution is
> if searching PATH for executables is pathologically slow (e.g. due to
> an NFS outage maybe).

Maybe I will include socklog-check in the future; for now I'm going to
apply your suggestion and close this bug.

Thanks for your contribution.
Lorenzo

> 
> > This bug can probably renamed as "default-syslog: useless inside a
> > container", right ?
> 
> I don't think so; that wouldn't be accurate. It's only useless if the
> syslog daemon and the check script run in different namespaces; if
> they run in the same container, it works, and it also fails if check
> runs on the host and it's the syslog daemon that's in the container
> (this should be rare though).
> 
> I'd call it "default-syslog: check for running syslogd not robust" or
> something.
> 

Reply via email to