Skip to content

Commit

Permalink
Revert "systemd: Use non-absolute paths in Exec* lines"
Browse files Browse the repository at this point in the history
This reverts commit 79b2094 since it
doesn't work with the systemd version shipped with RHEL7-based systems.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rich Ercolani <[email protected]>
Closes openzfs#14943
Closes openzfs#14945
  • Loading branch information
rincebrain authored Jun 7, 2023
1 parent 93f8abe commit 6c96269
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-import-cache.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ConditionPathIsDirectory=/sys/module/zfs
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-@initconfdir@/zfs
ExecStart=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]
WantedBy=zfs-import.target
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-import-scan.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ConditionPathIsDirectory=/sys/module/zfs
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-@initconfdir@/zfs
ExecStart=zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS
ExecStart=@sbindir@/zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS

[Install]
WantedBy=zfs-import.target
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-mount.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ConditionPathIsDirectory=/sys/module/zfs
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-@initconfdir@/zfs
ExecStart=zfs mount -a
ExecStart=@sbindir@/zfs mount -a

[Install]
WantedBy=zfs.target
10 changes: 5 additions & 5 deletions etc/systemd/system/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ConditionPathIsDirectory=/sys/module/zfs

[Service]
EnvironmentFile=-@initconfdir@/zfs
ExecStart=sh -c '\
if zpool status %i | grep -q "scrub in progress"; then\
exec zpool wait -t scrub %i;\
else exec zpool scrub -w %i; fi'
ExecStop=-sh -c 'zpool scrub -p %i 2>/dev/null || true'
ExecStart=/bin/sh -c '\
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'
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-share.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ConditionPathIsDirectory=/sys/module/zfs
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-@initconfdir@/zfs
ExecStart=zfs share -a
ExecStart=@sbindir@/zfs share -a

[Install]
WantedBy=zfs.target
10 changes: 5 additions & 5 deletions etc/systemd/system/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ConditionPathIsDirectory=/sys/module/zfs

[Service]
EnvironmentFile=-@initconfdir@/zfs
ExecStart=sh -c '\
if zpool status %i | grep -q "(trimming)"; then\
exec zpool wait -t trim %i;\
else exec zpool trim -w %i; fi'
ExecStop=-sh -c 'zpool trim -s %i 2>/dev/null || true'
ExecStart=/bin/sh -c '\
if @sbindir@/zpool status %i | grep -q "(trimming)"; then\
exec @sbindir@/zpool wait -t trim %i;\
else exec @sbindir@/zpool trim -w %i; fi'
ExecStop=-/bin/sh -c '@sbindir@/zpool trim -s %i 2>/dev/null || true'
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-volume-wait.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ConditionPathIsDirectory=/sys/module/zfs
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-@initconfdir@/zfs
ExecStart=zvol_wait
ExecStart=@bindir@/zvol_wait

[Install]
WantedBy=zfs-volumes.target
2 changes: 1 addition & 1 deletion etc/systemd/system/zfs-zed.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ConditionPathIsDirectory=/sys/module/zfs

[Service]
EnvironmentFile=-@initconfdir@/zfs
ExecStart=zed -F
ExecStart=@sbindir@/zed -F
Restart=always

[Install]
Expand Down

0 comments on commit 6c96269

Please sign in to comment.