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 <antonio.e.russo@gmail.com>
Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
Closes #10356
Closes #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
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

This comment has been minimized.

Copy link
@Rudd-O

Rudd-O Aug 30, 2020

Contributor

Can't this just be directed to console instead? I can imagine if the unit file fails, we'd like to see in the console why.

StandardError=null
ExecStart=${keyloadcmd}
ExecStop=${keyunloadcmd}" > "${dest_norm}/${keyloadunit}"
fi
Expand Down

0 comments on commit 62663fb

Please sign in to comment.