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.

Signed-off-by: Richard Laager <rlaager@wiktel.com>
Closes: openzfs#10356
  • Loading branch information
rlaager committed Aug 1, 2020
1 parent b6db7d7 commit 00e5e69
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 @@ -225,6 +225,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 00e5e69

Please sign in to comment.