Skip to content

Commit ff64096

Browse files
nabijaczlewelibehlendorf
authored andcommitted
systemd: import: expand $ZPOOL_IMPORT_OPTS correctly
Turns out $ZPOOL_IMPORT_OPTS expands in a shell-like fashion, yielding 'import' '-aN' '-o' 'cachefile=none' for an unset variable, and 'import' '-aN' '-o' 'cachefile=none' 'word1' 'word2' for a white-spaced one, but ${ZPOOL_IMPORT_OPTS} expands like "${Z_I_O}" would in a shell, yielding 'import' '-aN' '-o' 'cachefile=none' '' (empty) and 'import' '-aN' '-o' 'cachefile=none' 'word1 word2' (spaced) Fixes eec5ba1 "dracut: 90zfs: respect zfs_force=1 on systemd systems" Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes: #12231
1 parent 7e22129 commit ff64096

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

etc/systemd/system/zfs-import-cache.service.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ConditionPathIsDirectory=/sys/module/zfs
1414
[Service]
1515
Type=oneshot
1616
RemainAfterExit=yes
17-
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN ${ZPOOL_IMPORT_OPTS}
17+
ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS
1818

1919
[Install]
2020
WantedBy=zfs-import.target

etc/systemd/system/zfs-import-scan.service.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ConditionPathIsDirectory=/sys/module/zfs
1313
[Service]
1414
Type=oneshot
1515
RemainAfterExit=yes
16-
ExecStart=@sbindir@/zpool import -aN -o cachefile=none ${ZPOOL_IMPORT_OPTS}
16+
ExecStart=@sbindir@/zpool import -aN -o cachefile=none $ZPOOL_IMPORT_OPTS
1717

1818
[Install]
1919
WantedBy=zfs-import.target

0 commit comments

Comments
 (0)