From 17e15c2f54843e0f2c1ecff234e2e83f89c1c77f Mon Sep 17 00:00:00 2001 From: Daniel Wood Date: Fri, 29 Mar 2019 09:37:28 -0700 Subject: [PATCH] Fix systemd service definitions. `sanoid-prune.service` is not referenced by a timer, so I have removed it. I also modified the behavior of sanoid.service so it will take and prune snapshots according to the config file: - `--cron` switch is required for it to take action as a service - `--verbose` is there so that useful logs appear under `journalctl -t sanoid` (I personally run `--debug`) --- INSTALL.md | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index c4063a4..8b9b31d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -75,7 +75,7 @@ Create a systemd service: ```bash cat << "EOF" | sudo tee /etc/systemd/system/sanoid.service [Unit] -Description=Snapshot ZFS Pool +Description=Sanoid ZFS Snapshot Manager Requires=zfs.target After=zfs.target ConditionFileNotEmpty=/etc/sanoid/sanoid.conf @@ -83,23 +83,7 @@ ConditionFileNotEmpty=/etc/sanoid/sanoid.conf [Service] Environment=TZ=UTC Type=oneshot -ExecStart=/usr/local/sbin/sanoid --take-snapshots -EOF - -cat << "EOF" | sudo tee /etc/systemd/system/sanoid-prune.service -[Unit] -Description=Cleanup ZFS Pool -Requires=zfs.target -After=zfs.target sanoid.service -ConditionFileNotEmpty=/etc/sanoid/sanoid.conf - -[Service] -Environment=TZ=UTC -Type=oneshot -ExecStart=/usr/local/sbin/sanoid --prune-snapshots - -[Install] -WantedBy=sanoid.service +ExecStart=/usr/local/sbin/sanoid --cron --verbose EOF ```