mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-16 01:16:59 +02:00
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:
parent
465aad46fe
commit
667fb34b8a
6
sdk_container/src/third_party/coreos-overlay/sys-fs/mdadm/files/mdadm.service
vendored
Normal file
6
sdk_container/src/third_party/coreos-overlay/sys-fs/mdadm/files/mdadm.service
vendored
Normal 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
|
9
sdk_container/src/third_party/coreos-overlay/sys-fs/mdadm/files/mdadm.timer
vendored
Normal file
9
sdk_container/src/third_party/coreos-overlay/sys-fs/mdadm/files/mdadm.timer
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Weekly check for MD array's redundancy information.
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=weekly
|
||||||
|
Persistent=true
|
@ -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
|
|
@ -96,8 +96,10 @@ src_install() {
|
|||||||
insinto /etc/default
|
insinto /etc/default
|
||||||
newins "${FILESDIR}"/etc-default-mdadm mdadm
|
newins "${FILESDIR}"/etc-default-mdadm mdadm
|
||||||
|
|
||||||
exeinto /etc/cron.weekly
|
systemd_dounit "${FILESDIR}"/mdadm.service
|
||||||
newexe "${FILESDIR}"/mdadm.weekly mdadm
|
systemd_dounit "${FILESDIR}"/mdadm.timer
|
||||||
|
|
||||||
|
systemd_enable_service timers.target mdadm.timer
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
|
Loading…
Reference in New Issue
Block a user