I asked this question in Unix & Linux but I think it actually fits better here.
Currently, I use the following logrotate.d configuration
/var/log/messages
{
daily
compress
rotate 7
postrotate
/bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
endscript
}
However, I see in the official logrotate example in the syslog-ng repository, instead of doing a kill -HUP, they do a reload, eg:
/var/log/syslog.log {
rotate 7
daily
compress
postrotate
/etc/init.d/syslog-ng reload >/dev/null
endscript
}
Is there a significant difference between these two methods, that would make their way work but my way not work, or would you expect there to be some other problem? This is a pretty old syslog-ng version, so I'm not sure if that could be related as well.
For additional context, here is the reload function from my version of syslog-ng's init script.
reload()
{
verify_config
echo -n $"Reloading syslog-ng: "
killproc syslog-ng -HUP
RETVAL=$?
echo
return $RETVAL
}
I did check lsof, free memory, and more when the system was in a failed state and did not notice anything overly suspicious with the state of the system.