From 7fac62ff42b48da6c949abd36ffad1f19f559cb2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 28 Feb 2023 20:19:11 +0100 Subject: Removing cron jobs in favour of systemd timers. Signed-off-by: Daniel Baumann --- debian/mdadm.cron.d | 12 ------------ debian/mdadm.cron.daily | 21 --------------------- debian/mdadm.maintscript | 2 ++ debian/mdadm.postinst | 2 +- debian/rules | 3 +++ 5 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 debian/mdadm.cron.d delete mode 100644 debian/mdadm.cron.daily diff --git a/debian/mdadm.cron.d b/debian/mdadm.cron.d deleted file mode 100644 index 309d180..0000000 --- a/debian/mdadm.cron.d +++ /dev/null @@ -1,12 +0,0 @@ -# -# cron.d/mdadm -- schedules periodic redundancy checks of MD devices -# -# Copyright © martin f. krafft -# distributed under the terms of the Artistic Licence 2.0 -# - -# By default, run at 00:57 on every Sunday, but do nothing unless the day of -# the month is less than or equal to 7. Thus, only run on the first Sunday of -# each month. crontab(5) sucks, unfortunately, in this regard; therefore this -# hack (see #380425). -57 0 * * 0 root if [ -x /usr/share/mdadm/checkarray ] && [ $(date +\%d) -le 7 ]; then /usr/share/mdadm/checkarray --cron --all --idle --quiet; fi diff --git a/debian/mdadm.cron.daily b/debian/mdadm.cron.daily deleted file mode 100644 index 389d74b..0000000 --- a/debian/mdadm.cron.daily +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# cron.daily/mdadm -- daily check that MD devices are functional -# -# Copyright © 2008 Paul Slootman -# distributed under the terms of the Artistic Licence 2.0 - -# As recommended by the manpage, run -# mdadm --monitor --scan --oneshot -# every day to ensure that any degraded MD devices don't go unnoticed. -# Email will go to the address specified in /etc/mdadm/mdadm.conf . -# -set -eu - -MDADM=/sbin/mdadm -[ -x $MDADM ] || exit 0 # package may be removed but not purged - -[ -e /etc/default/mdadm ] && . /etc/default/mdadm -[ $AUTOSCAN = false ] && exit 0 - -exec $MDADM --monitor --scan --oneshot diff --git a/debian/mdadm.maintscript b/debian/mdadm.maintscript index 1298978..17b5e28 100644 --- a/debian/mdadm.maintscript +++ b/debian/mdadm.maintscript @@ -1,2 +1,4 @@ +rm_conffile /etc/cron.d/mdadm 4.2+20230227-1~ +rm_conffile /etc/cron.daily/mdadm 4.2+20230227-1~ rm_conffile /etc/init.d/mdadm 4.2+20230227-1~ rm_conffile /etc/init.d/mdadm-waitidle 4.2+20230227-1~ diff --git a/debian/mdadm.postinst b/debian/mdadm.postinst index 2314baf..c8a3420 100755 --- a/debian/mdadm.postinst +++ b/debian/mdadm.postinst @@ -76,7 +76,7 @@ AUTOCHECK=$AUTOCHECK # AUTOSCAN: # should mdadm check once a day for degraded arrays? See -# /etc/cron.daily/mdadm. +# /lib/systemd/system/mdmonitor-oneshot.service AUTOSCAN=$AUTOSCAN # START_DAEMON: diff --git a/debian/rules b/debian/rules index fd82966..e05fee1 100755 --- a/debian/rules +++ b/debian/rules @@ -31,3 +31,6 @@ override_dh_install: mkdir -p $(CURDIR)/debian/mdadm/etc/mdadm chmod +x $(CURDIR)/debian/mdadm/usr/share/mdadm/mdcheck + +override_dh_installsystemd: + dh_installsystemd -pmdadm mdcheck_continue.timer mdcheck_start.timer mdmonitor-oneshot.timer -- cgit v1.2.3