Last active
November 20, 2023 11:31
-
-
Save azmodude/6d9daae64685f229b48223505d8ea114 to your computer and use it in GitHub Desktop.
ZFS supplementary service files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Load %I encryption keys | |
Before=systemd-user-sessions.service zfs-mount.service | |
After=zfs-import.target | |
Requires=zfs-import.target | |
DefaultDependencies=no | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
# first try to load keyfile, if unsuccessful try to ask for a password and pipe it | |
ExecStart=/usr/bin/bash -c 'until (zfs load-key %I || systemd-ask-password "Encrypted ZFS password for %I" --no-tty | zfs load-key %I); do echo "Try again!"; done' | |
[Install] | |
WantedBy=zfs-mount.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Scrub ZFS Pool | |
Requires=zfs.target | |
After=zfs.target | |
[Service] | |
Type=oneshot | |
Nice=19 | |
IOSchedulingClass=idle | |
ExecStartPre=-/usr/sbin/zpool scrub -s %i | |
ExecStart=/usr/sbin/zpool scrub %i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Scrub ZFS pool twice a month on %i | |
[Timer] | |
OnCalendar=*-*-1,15 2:00:00 | |
Persistent=true | |
[Install] | |
WantedBy=timers.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment