newsyslog and pid files

Hi,

When is it necessary to send signal 30 to a pid with newsyslog?
Is there a way to figure out when it's needed?

What's the difference between these two for example?

Code:
/var/log/valkey/valkey.log 640 14 * $D04 J
/var/log/fail2ban.log 640 14 * $D04 J /var/run/fail2ban/fail2ban.pid 30
 
When is it necessary to send signal 30 to a pid with newsyslog?
Whenever said process keeps the log file open (filehandle). And it may not be SIGUSR1 (30), some processes require SIGHUP (1) (see signal(3)).
Is there a way to figure out when it's needed?
The documentation of the service in question should mention it.
What's the difference between these two for example?
Valkey might be sending it's logs through syslog(3) and thus doesn't have a file handle to the actual log file. It'll be syslogd(8) that handles the log files (syslog.conf(5)). Fail2ban doesn't use syslog(3) but opens and handles the log file on its own, it opens the file (filehandle) and writes to the filehandle.
 
Thank you,

That was very helpful!
Makes it much easier where to start, when configuring log rotations for other daemons.

MariaDB is next in line.

Thanks again for the explanation,
Much appreciated,
 
Back
Top