Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: runit logging help (Read 1649 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

runit logging help

Testing out/learning runit.  Seeking info on runits logging facility.  This is a runit install from base.

I understand how to enable logging for a particular service (the log directory) and have that working fine.  But not much, if anything gets logged.

Using openssh as an example.  I have setup /etc/runit/sv/sshd/log/run:
Code: [Select]
#!/bin/sh
exec svlogd -tt /var/log/ssh

I added echo 2>&1 to /etc/runit/sv/sshd/run to try to get more log response:
Code: [Select]
#!/bin/sh
echo 2>&1
ssh-keygen -A >/dev/null 2>&1 # Will generate host keys if they don't already exist
[ -r conf ] && . ./conf
exec /usr/bin/sshd -D $OPTS

But nothing interesting gets logged:
/var/log/ssh/current:
Code: [Select]
2021-08-17_23:27:21.71413 
2021-08-17_23:31:07.37343


The logged entries are probably when sshd is brought up.  I have remotely logged into this sshd several times, including failed attempts, nothing is logged.  Under an openrc based system, each attempted ssh login gets reported.  How/can I get this detail of logging in runit?






Re: runit logging help

Reply #1
You might want to check /var/log/messages (or whatever file is used by your syslog implementation), as that's where sshd sends logs by default.

Re: runit logging help

Reply #2
svlogd only captures stderr (or stdout, i don't remember exactly) but messages can also be sent to syslog. To handle it you can install any syslog package or socklog
ARMtix

Re: runit logging help

Reply #3
OK, understand syslog.

I mistakenly thought that runit somehow magically logged EVERYTHING to its logging facility.

Thanks!