docker-tools
docker-tools copied to clipboard
[rsyslogd] [logrotate] proper way to reload `rsyslog` after doing logrotation
In logrotate examples of how to handle rsyslog's logs it's suggested to have lines like that et the end of config:
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
In this image there is no openRC, no services instead rsyslogd is just started in entrypoint.sh. So this command fails:
/ # reload rsyslog
sh: reload: not found
and as a result after logs rotation new file is not written.
Solution I've found working was to use this in logrotate config
postrotate
pkill -HUP rsyslogd || true
endscript
to reload rsyslogd.
It's not exactly problem with this image, but I think a note about it in README.md might help others.