Fixes the concurrent execution of logrotate

Change-Id: I1546744d3c4cab8fc359b6571d99aabde3c3ff2d
Closes-bug: #1455104
(cherry picked from commit 99508dbc39)
This commit is contained in:
Swann Croiset 2016-08-16 15:50:55 +02:00
parent 6637b2cffc
commit 7ee4a5b53b
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ fail() {
else
MESSAGE=$1
fi
/usr/bin/logger -t logrotate "${MESSAGE}"
/usr/bin/logger -t logrotate "<%= @service_name %> ${MESSAGE}"
unlock
exit 1
}
@ -30,7 +30,7 @@ lock || fail "WARNING <%= @service_name %> logrotate flock failed, exiting"
TMP_FILE=$(/bin/mktemp)
nice ionice -c3 /usr/sbin/logrotate <%= @logrotate_conf %> >& $TMP_FILE
nice ionice -c3 /usr/sbin/logrotate -s /var/lib/logrotate/<%= @service_name %>.status <%= @logrotate_conf %> >& $TMP_FILE
EXITVALUE=$?
if [ -f /etc/redhat-release ] || [ -f /etc/centos-release ];