| 1 |
Description: Handles correctly the presence of systemd |
| 2 |
The /etc/cron.daily/logrotate used to be less good than the original |
| 3 |
Debian package version. Let's switch back to it. |
| 4 |
Author: Thomas Goirand <[email protected]> |
| 5 |
Forwarded: no |
| 6 |
Last-Update: 2024-12-02 |
| 7 |
|
| 8 |
--- puppet-module-rodjek-logrotate-1.1.1+ds1.orig/files/etc/cron.daily/logrotate |
| 9 |
+++ puppet-module-rodjek-logrotate-1.1.1+ds1/files/etc/cron.daily/logrotate |
| 10 |
@@ -2,5 +2,19 @@ |
| 11 |
# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET. ANY CHANGES WILL BE |
| 12 |
# OVERWRITTEN. |
| 13 |
|
| 14 |
|
| 15 |
+# skip in favour of systemd timer |
| 16 |
+if [ -d /run/systemd/system ]; then |
| 17 |
+ exit 0 |
| 18 |
+fi |
| 19 |
+ |
| 20 |
+# this cronjob persists removals (but not purges) |
| 21 |
+if [ ! -x /usr/sbin/logrotate ]; then |
| 22 |
+ exit 0 |
| 23 |
+fi |
| 24 |
+ |
| 25 |
/usr/sbin/logrotate /etc/logrotate.conf |
| 26 |
+EXITVALUE=$? |
| 27 |
+if [ $EXITVALUE != 0 ]; then |
| 28 |
+ /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" |
| 29 |
+fi |
| 30 |
+exit $EXITVALUE |