It's not exactly clear what you mean :-)

In case of rsyslog, the killall -HUP (be wary about the killall command - getting used to it can have disastrous effects if you're on a wrong system - https://en.wikipedia.org/wiki/Killall ) makes the rsyslogd process reopen the log files (and re-read _some_ configuration files; but only very selected subset - in order to apply new configuration you generally need to restart the rsyslogd completely).

Which means that typically

1. rsyslogd works as usual

2. logrotate wakes up and rotates the files - the log files change their names (for example - /var/log/messages becomes /var/log/messages.1). But files are still open - rsyslogd can still write to the descriptors it opened long ago. The data lands in the same files, it's just that they are named differently now. So in our example - rsyslog is writing to /var/log/messages.1.

3. logrotate sends SIGHUP to rsyslogd as part of postrotate action

4. rsyslogd receives SIGHUP, closes its file descriptors and opens new ones with the filenames specified in configuration (so closes /var/log/messages.1 and creates /var/log/messages again).

5. optionally - logrotate compresses rotated files

That's how you normally do it.

On 19.01.2022 11:11, Helmut Schneider via rsyslog wrote:
Hi,

is there a rule when to issue a rotate / reload command? I'm referring to "postrotate" in logrotate.

https://docs.rackspace.com/support/how-to/understanding-logrotate-utility/

Thank you!

_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to