Restart rsyslogd after logrotate

The copytruncate directive in logrotate configuration truncates the log file so
that processes can keep using the same file descriptor to write to the log
file. The truncation, however, does not work well with rsyslog forwarding as
rsyslog fails to figure out the difference from last sent messages.

This change restarts rsyslogd in postrotate directive of logrotate such as
rsyslog will start with a new baseline and continue forwarding logs.

Closes-Bug: 1564654
Change-Id: Ied15bc73e5af78bfcc1430db787b61d65a9bc044
Signed-off-by: Shu Shen <sshen@siaras.com>
This commit is contained in:
Shu Shen 2016-03-31 16:10:02 -07:00
parent 2246bd2bee
commit 04b8a98f2b
1 changed files with 3 additions and 0 deletions

View File

@ -11,4 +11,7 @@
maxage 60
notifempty
nocreate
postrotate
restart rsyslog 2>&1 || true
endscript
}