Hi,

as mentioned in my last email, here is a patch that will cause the 
cron.daily/etckeeper to be skipped if etckeeper.timer is active. I went for the 
approach to actually check whether the timer is active rather than merely 
checking if /run/systemd/system exists which is what other cron.daily scritps 
do when they want to bail out in favor of a timer unit. The reason is simply 
that I wasn't sure whether it's safe to assume that the timer is enabled or if 
a user may have disabled it but expects the cron.daily script to run. But feel 
free to change that to whatever behavior you prefer.

Regards,

Timo


>From 16966e16c7d79148dbe8676b38ff666624f050b3 Mon Sep 17 00:00:00 2001
From: Timo Sigurdsson <public_tim...@silentcreek.de>
Date: Fri, 17 Apr 2020 19:05:33 +0200
Subject: [PATCH] Fix Debian etckeeper bug #883263.

---
 cron.daily/etckeeper | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cron.daily/etckeeper b/cron.daily/etckeeper
index eb74401..3266faa 100755
--- a/cron.daily/etckeeper
+++ b/cron.daily/etckeeper
@@ -1,5 +1,10 @@
 #!/bin/sh
 set -e
+# Don't run on systemd systems with an active etckeeper.timer unit.
+if [ -d /run/systemd/system ] && [ -x /bin/systemctl ] && /bin/systemctl -q is-active etckeeper.timer; then
+	exit 0
+fi
+
 if [ -e /etc/etckeeper/daily ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
 	. /etc/etckeeper/etckeeper.conf
 	if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
-- 
2.20.1

Reply via email to