mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
systemd: read initconfdir
Systemd units do not read @initconfdir@ but refer to variables defined there, also a minor fixup in zfs-scrub service file. Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com> Signed-off-by: Krzysztof Piecuch <piecuch@kpiecuch.pl> Closes #12946
This commit is contained in:
parent
7454ca413c
commit
ccdcc1dbe8
@ -14,6 +14,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-@initconfdir@/zfs
|
||||
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS
|
||||
|
||||
[Install]
|
||||
|
@ -13,6 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-@initconfdir@/zfs
|
||||
ExecStart=@sbindir@/zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS
|
||||
|
||||
[Install]
|
||||
|
@ -11,6 +11,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-@initconfdir@/zfs
|
||||
ExecStart=@sbindir@/zfs mount -a
|
||||
|
||||
[Install]
|
||||
|
@ -7,8 +7,9 @@ ConditionACPower=true
|
||||
ConditionPathIsDirectory=/sys/module/zfs
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-@initconfdir@/zfs
|
||||
ExecStart=/bin/sh -c '\
|
||||
if @sbindir@/zpool status %i | grep "scrub in progress"; then\
|
||||
if @sbindir@/zpool status %i | grep -q "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'
|
||||
|
@ -13,6 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-@initconfdir@/zfs
|
||||
ExecStart=@sbindir@/zfs share -a
|
||||
|
||||
[Install]
|
||||
|
@ -8,6 +8,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-@initconfdir@/zfs
|
||||
ExecStart=@bindir@/zvol_wait
|
||||
|
||||
[Install]
|
||||
|
@ -4,6 +4,7 @@ Documentation=man:zed(8)
|
||||
ConditionPathIsDirectory=/sys/module/zfs
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-@initconfdir@/zfs
|
||||
ExecStart=@sbindir@/zed -F
|
||||
Restart=on-abort
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user