diff options
author | Georgy Yakovlev <gyakovlev@gentoo.org> | 2021-12-23 14:08:39 -0800 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2021-12-23 14:27:12 -0800 |
commit | 94a129e0e7930ec5537be5f4fc5c84cb0e7a48bd (patch) | |
tree | e9bf50a393fbcd4e5b152ee001a83f6b6c0879b9 /sys-fs/zfs/files | |
parent | sys-fs/zfs-kmod: add 2.0.7 (diff) | |
download | gentoo-94a129e0e7930ec5537be5f4fc5c84cb0e7a48bd.tar.gz gentoo-94a129e0e7930ec5537be5f4fc5c84cb0e7a48bd.tar.bz2 gentoo-94a129e0e7930ec5537be5f4fc5c84cb0e7a48bd.zip |
sys-fs/zfs: add 2.0.7
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'sys-fs/zfs/files')
-rw-r--r-- | sys-fs/zfs/files/2.0.7-scrub-timers.patch | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/sys-fs/zfs/files/2.0.7-scrub-timers.patch b/sys-fs/zfs/files/2.0.7-scrub-timers.patch new file mode 100644 index 000000000000..7c7bd1b874ea --- /dev/null +++ b/sys-fs/zfs/files/2.0.7-scrub-timers.patch @@ -0,0 +1,99 @@ +From 2c9844d159024d4c742d24639a218213fb53d537 Mon Sep 17 00:00:00 2001 +From: Georgy Yakovlev <gyakovlev@gentoo.org> +Date: Sat, 22 May 2021 22:27:39 -0700 +Subject: [PATCH 1/2] systemd: add weekly and monthly scrub timers + +timers can be enabled as follows: + +systemctl enable zfs-scrub-weekly@rpool.timer --now +systemctl enable zfs-scrub-monthly@datapool.timer --now + +Each timer will pull in zfs-scrub@${poolname}.service, which is not +schedule-specific. + +Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> +--- + etc/systemd/system/.gitignore | 1 + + etc/systemd/system/Makefile.am | 5 ++++- + etc/systemd/system/zfs-scrub-monthly@.timer.in | 12 ++++++++++++ + etc/systemd/system/zfs-scrub-weekly@.timer.in | 12 ++++++++++++ + etc/systemd/system/zfs-scrub@.service.in | 14 ++++++++++++++ + 5 files changed, 43 insertions(+), 1 deletion(-) + create mode 100644 etc/systemd/system/zfs-scrub-monthly@.timer.in + create mode 100644 etc/systemd/system/zfs-scrub-weekly@.timer.in + create mode 100644 etc/systemd/system/zfs-scrub@.service.in + +diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am +index c374a52ac..5e65e1db4 100644 +--- a/etc/systemd/system/Makefile.am ++++ b/etc/systemd/system/Makefile.am +@@ -12,7 +12,10 @@ systemdunit_DATA = \ + zfs-volume-wait.service \ + zfs-import.target \ + zfs-volumes.target \ +- zfs.target ++ zfs.target \ ++ zfs-scrub-monthly@.timer \ ++ zfs-scrub-weekly@.timer \ ++ zfs-scrub@.service + + SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA) + +diff --git a/etc/systemd/system/zfs-scrub-monthly@.timer.in b/etc/systemd/system/zfs-scrub-monthly@.timer.in +new file mode 100644 +index 000000000..903068468 +--- /dev/null ++++ b/etc/systemd/system/zfs-scrub-monthly@.timer.in +@@ -0,0 +1,12 @@ ++[Unit] ++Description=Monthly zpool scrub timer for %i ++Documentation=man:zpool-scrub(8) ++ ++[Timer] ++OnCalendar=monthly ++Persistent=true ++RandomizedDelaySec=1h ++Unit=zfs-scrub@%i.service ++ ++[Install] ++WantedBy=timers.target +diff --git a/etc/systemd/system/zfs-scrub-weekly@.timer.in b/etc/systemd/system/zfs-scrub-weekly@.timer.in +new file mode 100644 +index 000000000..ede699500 +--- /dev/null ++++ b/etc/systemd/system/zfs-scrub-weekly@.timer.in +@@ -0,0 +1,12 @@ ++[Unit] ++Description=Weekly zpool scrub timer for %i ++Documentation=man:zpool-scrub(8) ++ ++[Timer] ++OnCalendar=weekly ++Persistent=true ++RandomizedDelaySec=1h ++Unit=zfs-scrub@%i.service ++ ++[Install] ++WantedBy=timers.target +diff --git a/etc/systemd/system/zfs-scrub@.service.in b/etc/systemd/system/zfs-scrub@.service.in +new file mode 100644 +index 000000000..c04ac292a +--- /dev/null ++++ b/etc/systemd/system/zfs-scrub@.service.in +@@ -0,0 +1,14 @@ ++[Unit] ++Description=zpool scrub on %i ++Documentation=man:zpool-scrub(8) ++Requires=zfs.target ++After=zfs.target ++ConditionACPower=true ++ConditionPathIsDirectory=/sys/module/zfs ++ ++[Service] ++ExecStart=/bin/sh -c '\ ++if @sbindir@/zpool status %i | grep "scrub in progress"; then\ ++exec @sbindir@/zpool wait -t scrub %i;\ ++else exec @sbindir@/zpool scrub -w %i; fi' ++ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true' +-- +2.34.1 |