From ce93d89ec88834576090bf8e286350604ff722b7 Mon Sep 17 00:00:00 2001 From: John Ramsden Date: Sat, 20 Apr 2019 15:31:00 -0700 Subject: [PATCH] Declare that sanoid service 'Wants' sanoid-prune Also add --verbose flag for logging as mentioned in readme. sanoid-prune.service never runs. Declare a 'Wants' dependency, and 'Before' condition in the sanoid unit, and prune is run after 'sanoid.service'. --- INSTALL.md | 2 ++ packages/debian/sanoid-prune.service | 2 +- packages/debian/sanoid.service | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 88435d0..f4e4049 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -78,6 +78,8 @@ cat << "EOF" | sudo tee /etc/systemd/system/sanoid.service Description=Snapshot ZFS Pool Requires=zfs.target After=zfs.target +Wants=sanoid-prune.service +Before=sanoid-prune.service ConditionFileNotEmpty=/etc/sanoid/sanoid.conf [Service] diff --git a/packages/debian/sanoid-prune.service b/packages/debian/sanoid-prune.service index c956bd5..f28dfef 100644 --- a/packages/debian/sanoid-prune.service +++ b/packages/debian/sanoid-prune.service @@ -7,7 +7,7 @@ ConditionFileNotEmpty=/etc/sanoid/sanoid.conf [Service] Environment=TZ=UTC Type=oneshot -ExecStart=/usr/sbin/sanoid --prune-snapshots +ExecStart=/usr/sbin/sanoid --prune-snapshots --verbose [Install] WantedBy=sanoid.service diff --git a/packages/debian/sanoid.service b/packages/debian/sanoid.service index e146354..c905527 100644 --- a/packages/debian/sanoid.service +++ b/packages/debian/sanoid.service @@ -2,9 +2,11 @@ Description=Snapshot ZFS Pool Requires=zfs.target After=zfs.target +Wants=sanoid-prune.service +Before=sanoid-prune.service ConditionFileNotEmpty=/etc/sanoid/sanoid.conf [Service] Environment=TZ=UTC Type=oneshot -ExecStart=/usr/sbin/sanoid --take-snapshots +ExecStart=/usr/sbin/sanoid --take-snapshots --verbose