pull swarm closures through the nix daemon: substituters in the fragment, merged root-only netrc
This commit is contained in:
parent
63ae5d6cbf
commit
ef68baa00f
1 changed files with 582 additions and 382 deletions
|
|
@ -61,7 +61,9 @@
|
|||
# <unit> <path> [systemctl option…]. Nothing unless `written_after_start`.
|
||||
# Otherwise a running <unit> is restarted and a failed one — it may have
|
||||
# hit its start limit without the credential — is reset and started; one
|
||||
# stopped on purpose stays stopped. `--no-block` because a caller ordered
|
||||
# that is neither running nor failed (stopped on purpose, never started, or
|
||||
# a per-connection daemon with no unit of its own) is left alone, and
|
||||
# nothing is logged for it. `--no-block` because a caller ordered
|
||||
# `Before=` its consumer must not wait on a job that waits on the caller
|
||||
# (see `swarm-services-cert`'s propagation in ../hive-tls.nix).
|
||||
refresh_unit() {
|
||||
|
|
@ -72,8 +74,8 @@
|
|||
echo "$path changed after $unit last started, and $unit had failed — starting it"
|
||||
systemctl "$@" reset-failed "$unit"
|
||||
systemctl "$@" start --no-block "$unit"
|
||||
else
|
||||
echo "$path changed after $unit last started — restarting it if it runs"
|
||||
elif systemctl "$@" is-active --quiet "$unit"; then
|
||||
echo "$path changed after $unit last started — restarting it"
|
||||
systemctl "$@" try-restart --no-block "$unit"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue