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'.
This commit is contained in:
parent
dd47dd5368
commit
ce93d89ec8
|
@ -78,6 +78,8 @@ cat << "EOF" | sudo tee /etc/systemd/system/sanoid.service
|
||||||
Description=Snapshot ZFS Pool
|
Description=Snapshot ZFS Pool
|
||||||
Requires=zfs.target
|
Requires=zfs.target
|
||||||
After=zfs.target
|
After=zfs.target
|
||||||
|
Wants=sanoid-prune.service
|
||||||
|
Before=sanoid-prune.service
|
||||||
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
|
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|
|
@ -7,7 +7,7 @@ ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
|
||||||
[Service]
|
[Service]
|
||||||
Environment=TZ=UTC
|
Environment=TZ=UTC
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/sbin/sanoid --prune-snapshots
|
ExecStart=/usr/sbin/sanoid --prune-snapshots --verbose
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=sanoid.service
|
WantedBy=sanoid.service
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
Description=Snapshot ZFS Pool
|
Description=Snapshot ZFS Pool
|
||||||
Requires=zfs.target
|
Requires=zfs.target
|
||||||
After=zfs.target
|
After=zfs.target
|
||||||
|
Wants=sanoid-prune.service
|
||||||
|
Before=sanoid-prune.service
|
||||||
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
|
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=TZ=UTC
|
Environment=TZ=UTC
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/sbin/sanoid --take-snapshots
|
ExecStart=/usr/sbin/sanoid --take-snapshots --verbose
|
||||||
|
|
Loading…
Reference in New Issue