Browse Source

Fixes the concurrent execution of logrotate

Change-Id: I1546744d3c4cab8fc359b6571d99aabde3c3ff2d
Closes-bug: #1455104
(cherry picked from commit 99508dbc39)
tags/0.9-eol^0
Swann Croiset 2 years ago
parent
commit
7ee4a5b53b

+ 2
- 2
deployment_scripts/puppet/modules/heka/templates/logrotate.cron.erb View File

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

Loading…
Cancel
Save