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]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS
|
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -13,6 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
ExecStart=@sbindir@/zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS
|
ExecStart=@sbindir@/zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -11,6 +11,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
ExecStart=@sbindir@/zfs mount -a
|
ExecStart=@sbindir@/zfs mount -a
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -7,8 +7,9 @@ ConditionACPower=true
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
ExecStart=/bin/sh -c '\
|
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;\
|
exec @sbindir@/zpool wait -t scrub %i;\
|
||||||
else exec @sbindir@/zpool scrub -w %i; fi'
|
else exec @sbindir@/zpool scrub -w %i; fi'
|
||||||
ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true'
|
ExecStop=-/bin/sh -c '@sbindir@/zpool scrub -p %i 2>/dev/null || true'
|
||||||
|
|
|
@ -13,6 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
ExecStart=@sbindir@/zfs share -a
|
ExecStart=@sbindir@/zfs share -a
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -8,6 +8,7 @@ ConditionPathIsDirectory=/sys/module/zfs
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
ExecStart=@bindir@/zvol_wait
|
ExecStart=@bindir@/zvol_wait
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -4,6 +4,7 @@ Documentation=man:zed(8)
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
EnvironmentFile=-@initconfdir@/zfs
|
||||||
ExecStart=@sbindir@/zed -F
|
ExecStart=@sbindir@/zed -F
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue