mdadm: migrate cron.weekly to systemd.timer (#1244)

Add mdadm timer and service files and remove the unused weekly cron
This commit is contained in:
Aniruddha Basak 2021-09-03 00:40:57 +05:30 committed by Dongsu Park
parent 465aad46fe
commit 667fb34b8a
4 changed files with 19 additions and 7 deletions

View File

@ -0,0 +1,6 @@
[Unit]
Description=Initiates a check run of an MD array's redundancy information.
[Service]
Type=oneshot
ExecStart=/usr/sbin/checkarray --cron --all --idle --quiet

View File

@ -0,0 +1,9 @@
[Unit]
Description=Weekly check for MD array's redundancy information.
[Install]
WantedBy=timers.target
[Timer]
OnCalendar=weekly
Persistent=true

View File

@ -1,5 +0,0 @@
#!/bin/sh
# This requires that AUTOCHECK is true in /etc/default/mdadm
if [ -x /usr/sbin/checkarray ] && [ $(date +\%d) -le 7 ]; then
/usr/sbin/checkarray --cron --all --idle --quiet
fi

View File

@ -96,8 +96,10 @@ src_install() {
insinto /etc/default
newins "${FILESDIR}"/etc-default-mdadm mdadm
exeinto /etc/cron.weekly
newexe "${FILESDIR}"/mdadm.weekly mdadm
systemd_dounit "${FILESDIR}"/mdadm.service
systemd_dounit "${FILESDIR}"/mdadm.timer
systemd_enable_service timers.target mdadm.timer
}
pkg_postinst() {