Skip to content

Commit

Permalink
bootc-fstab-edit: improve service dependencies
Browse files Browse the repository at this point in the history
Looking at the target definitions:
- multi-user.target Requires basic.target
- basic.target Requires sysinit.target
- sysinit.target Wants local-fs.target
- local-fs.target is After local-fs-pre.target

local-fs-pre.target is wanted by some services, but it's indirect,
so it's cleaner to be WantedBy local-fs.target and Wants local-fs-pre.target.

While at it add Conflicts=shutdown.target.

Signed-off-by: Etienne Champetier <[email protected]>
  • Loading branch information
champtar committed Feb 14, 2025
1 parent 8ffe361 commit 996e26d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ fn generate_fstab_editor(unit_dir: &Dir) -> Result<()> {
EDIT_UNIT,
"[Unit]\n\
DefaultDependencies=no\n\
Conflicts=shutdown.target\n\
After=systemd-fsck-root.service\n\
Before=local-fs-pre.target local-fs.target shutdown.target systemd-remount-fs.service\n\
Wants=local-fs-pre.target\n\
\n\
[Service]\n\
Type=oneshot\n\
RemainAfterExit=yes\n\
ExecStart=bootc internals fixup-etc-fstab\n\
",
)?;
let target = "local-fs-pre.target.wants";
let target = "local-fs.target.wants";
unit_dir.create_dir_all(target)?;
unit_dir.symlink(&format!("../{EDIT_UNIT}"), &format!("{target}/{EDIT_UNIT}"))?;
Ok(())
Expand Down

0 comments on commit 996e26d

Please sign in to comment.