summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@leap.se>2015-07-21 11:00:50 -0400
committerMicah Anderson <micah@leap.se>2015-07-21 11:00:50 -0400
commit7c071c8e5953922040175c9bfdb458effb982847 (patch)
treeddc56639a1438d1aeea5d528359df7cc3a5f5621
parentd609a948520e38feb79892eec6c80f3915940444 (diff)
Fix leap-mx logrotation to work with twistd (#7058)
We don't want to try and create the log file, twistd will do that. Don’t rename the log file from mx.log to mx.log.0, instead just copy it to mx.log.1, and then clear out mx.log so it’s empty (this is needed because leap-mx might assume that its file descriptor is still valid and continue trying to write to it, without this, leap-mx might lose data because it’ll assume the original log file is still around and continue to write to it, even though it’s gone)It’s a little dangerous because it’s possible that you might lose some logged data between the time that logrotate copies the new log file and truncates the old file (Caveat administrator). Finally, we don't want logrotate to complain if it finds mx.log, its ok if its there. Change-Id: I9952627f4d47e7a89a2915f6b72d82f9e6ca0d8b
-rw-r--r--puppet/modules/leap_mx/manifests/init.pp4
1 files changed, 3 insertions, 1 deletions
diff --git a/puppet/modules/leap_mx/manifests/init.pp b/puppet/modules/leap_mx/manifests/init.pp
index 2986f622..284662d2 100644
--- a/puppet/modules/leap_mx/manifests/init.pp
+++ b/puppet/modules/leap_mx/manifests/init.pp
@@ -83,9 +83,11 @@ class leap_mx {
'set file /var/log/leap/mx.log',
'set rotate 5',
'set schedule daily',
+ 'clear nocreate',
+ 'rm create',
+ 'rm ifempty',
'set compress compress',
'set missingok missingok',
- 'set ifempty notifempty',
'set copytruncate copytruncate'
]
}