Skip to content

Commit

Permalink
Fix another dependency loop
Browse files Browse the repository at this point in the history
zfs-load-key-DATASET.service was gaining an
After=systemd-journald.socket due to its stdout/stderr going to the
journal (which is the default).  systemd-journald.socket has an After
(via RequiresMountsFor=/run/systemd/journal) on -.mount.  If the root
filesystem is encrypted, -.mount gets an After
zfs-load-key-DATASET.service.

By setting stdout and stderr to null on the key load services, we avoid
this loop.

Reviewed-by: Antonio Russo <[email protected]>
Reviewed-by: InsanePrawn <[email protected]>
Signed-off-by: Richard Laager <[email protected]>
Closes openzfs#10356
Closes openzfs#10388
  • Loading branch information
rlaager authored and behlendorf committed Aug 28, 2020
1 parent ec41caf commit 62663fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions etc/systemd/system-generators/zfs-mount-generator.in
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ ${keymountdep}
[Service]
Type=oneshot
RemainAfterExit=yes
# This avoids a dependency loop involving systemd-journald.socket if this
# dataset is a parent of the root filesystem.
StandardOutput=null
StandardError=null
ExecStart=${keyloadcmd}
ExecStop=${keyunloadcmd}" > "${dest_norm}/${keyloadunit}"
fi
Expand Down

0 comments on commit 62663fb

Please sign in to comment.