Skip to content

Commit

Permalink
fix: dont run reload on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Mar 18, 2024
1 parent 99abf82 commit d9f01fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions unify/src-script/unify.ysh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ proc hook_files( ; ; ctx, cfg) {
var newunits="$(mktemp -d)"
/etc/systemd/system-generators/nix-unify-generator "$newunits" >/dev/null

# will run systemctl daemon-reload
env toplevel="$toplevel" oldunits="$oldunits" newunits="$newunits" "$self/reload-units.pl" switch
# dont run this to avoid races - during boot systemd will start everything as needed anyways
if (not ctx.is_boot) {
# will run systemctl daemon-reload
env toplevel="$toplevel" oldunits="$oldunits" newunits="$newunits" "$self/reload-units.pl" switch
}

rm -rf "$oldunits" "$newunits"
}
Expand All @@ -66,7 +69,7 @@ proc main(cmd ; cfg) {

rm-link "$toplevel" /run/current-system

var ctx = { links: cfg.files }
var ctx = { links: cfg.files, is_boot: cmd === "at_boot" }

@handlerblock@
}
Expand Down

0 comments on commit d9f01fe

Please sign in to comment.