Artix Linux Forum

Artix Linux => System => Topic started by: dxrobertson on 18 August 2021, 01:52:05

Title: runit logging help
Post by: dxrobertson on 18 August 2021, 01:52:05
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?





Title: Re: runit logging help
Post by: capezotte on 18 August 2021, 03:51:33
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.
Title: Re: runit logging help
Post by: phoenix_king_rus on 18 August 2021, 08:25:04
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
Title: Re: runit logging help
Post by: dxrobertson on 18 August 2021, 12:09:14
OK, understand syslog.

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

Thanks!