Your message dated Thu, 23 Jan 2025 06:49:05 +0000
with message-id <[email protected]>
and subject line Bug#1055994: fixed in mdadm 4.4-2
has caused the Debian Bug report #1055994,
regarding mdadm: Please restore cron scripts for use when systemd timers are 
not available
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1055994: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055994
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mdadm
Version: 4.2+20230508-7
Severity: normal
Tags: patch

Dear Daniel,

As was discussed in #1037496, the removal of cron scripts from mdadm means that
no mdamd housekeeping is performed when systemd timers are not available.

I attach a patch which restores the cron scripts in mdadm, but protects them
with a test for running systemd. This should mean that housekeeping tasks are
performed an all systems, but that there is no duplication when systemd timers
are available.

I hope this is an acceptable compromise and I look forward to your comments.

With best wishes

Mark
>From 1f4b2370e6ffaab0b6352b893f268e0fa39df55b Mon Sep 17 00:00:00 2001
From: Mark Hindley <[email protected]>
Date: Tue, 14 Nov 2023 19:52:52 +0000
Subject: [PATCH] Restore cron fragments, but prefer systemd timers.

---
 debian/mdadm.cron.d      | 12 ++++++++++++
 debian/mdadm.cron.daily  | 23 +++++++++++++++++++++++
 debian/mdadm.maintscript |  2 --
 debian/mdadm.postinst    |  3 ++-
 4 files changed, 37 insertions(+), 3 deletions(-)
 create mode 100644 debian/mdadm.cron.d
 create mode 100644 debian/mdadm.cron.daily

diff --git a/debian/mdadm.cron.d b/debian/mdadm.cron.d
new file mode 100644
index 0000000..63f186d
--- /dev/null
+++ b/debian/mdadm.cron.d
@@ -0,0 +1,12 @@
+#
+# cron.d/mdadm -- schedules periodic redundancy checks of MD devices
+#
+# Copyright © martin f. krafft <[email protected]>
+# 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 ] && [ ! -d /run/systemd/system ] && [ $(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
new file mode 100644
index 0000000..8d1bfeb
--- /dev/null
+++ b/debian/mdadm.cron.daily
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# cron.daily/mdadm -- daily check that MD devices are functional
+#
+# Copyright © 2008 Paul Slootman <[email protected]>
+# 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
+
+[ -d /run/systemd/system ] || exit 0 # Defer to systemd timers if possible
+
+[ -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 17b5e28..1298978 100644
--- a/debian/mdadm.maintscript
+++ b/debian/mdadm.maintscript
@@ -1,4 +1,2 @@
-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 c8a3420..021912a 100755
--- a/debian/mdadm.postinst
+++ b/debian/mdadm.postinst
@@ -76,7 +76,8 @@ AUTOCHECK=$AUTOCHECK
 
 # AUTOSCAN:
 #   should mdadm check once a day for degraded arrays? See
-#   /lib/systemd/system/mdmonitor-oneshot.service
+#   /lib/systemd/system/mdmonitor-oneshot.service and
+#   /etc/cron.daily/mdadm.
 AUTOSCAN=$AUTOSCAN
 
 # START_DAEMON:
-- 
2.39.2


--- End Message ---
--- Begin Message ---
Source: mdadm
Source-Version: 4.4-2
Done: Daniel Baumann <[email protected]>

We believe that the bug you reported is fixed in the latest version of
mdadm, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <[email protected]> (supplier of updated mdadm 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 23 Jan 2025 07:29:48 +0100
Source: mdadm
Architecture: source
Version: 4.4-2
Distribution: sid
Urgency: medium
Maintainer: Daniel Baumann <[email protected]>
Changed-By: Daniel Baumann <[email protected]>
Closes: 1055994
Changes:
 mdadm (4.4-2) sid; urgency=medium
 .
   * Uploading to sid.
   * Removing readlink-path.patch, not needed anymore with usr-merge.
   * Extending note about non-systemd systems to not run maintenance tasks
     either (Closes: #1055994).
   * Refreshing debconf files.
Checksums-Sha1:
 3040d0e4d48a542baaf214d0340df8aef7c8bf12 1424 mdadm_4.4-2.dsc
 0be0f0cb677d164cd2b01a5e431d1a33e37005de 88924 mdadm_4.4-2.debian.tar.xz
 577689723ff899eb52879e7323a45423230c6e05 5762 mdadm_4.4-2_amd64.buildinfo
Checksums-Sha256:
 baeab2216a2dec5062b2f4de2080574c86b69e843fe5adfffc1d8a107a44f4f3 1424 
mdadm_4.4-2.dsc
 89e5cb3f422b1a04ec751a289d7c677ef8c05ae85f20e89efb3239faa4f1dcbc 88924 
mdadm_4.4-2.debian.tar.xz
 feed32d53a265f6c7db3c94eb851020ecbe22e62ff9744a16edb55215254daa9 5762 
mdadm_4.4-2_amd64.buildinfo
Files:
 4aa1e48cfba5c8c725032906a031ebef 1424 admin optional mdadm_4.4-2.dsc
 3cac24d2433d00b0ca0b2d85c9596c54 88924 admin optional mdadm_4.4-2.debian.tar.xz
 92d81aa2cbf25e359f6283a953288569 5762 admin optional 
mdadm_4.4-2_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQmmGg4gLaoSj0ERgL7tPDoCoAiLwUCZ5HiXAAKCRD7tPDoCoAi
L72vAP9b95jHmFblK0Z4U2M9P83BegUdFV19AAsjnrUxVREI5QEAq+2JUccGbrgN
73hO7+2ycYCbGoVX35rHLdtDjI3E3gA=
=ZQ2B
-----END PGP SIGNATURE-----

Attachment: pgpiDFk5If6Zq.pgp
Description: PGP signature


--- End Message ---

Reply via email to