Reload the service manager's units before restarting a service whose files changed, and start the guard before the network as the controller declares it (hq ADR 0100)

This commit is contained in:
2026-09-22 17:38:17 +02:00
parent 3e0e6e6b7e
commit 6eabed63eb
4 changed files with 37 additions and 1 deletions
+8
View File
@@ -246,3 +246,11 @@ func (arch) AddUserToGroup(ctx context.Context, run Runner, name, group string)
}
return nil
}
// ReloadUnits has systemd read its unit files again. A unit file that changed on disk is otherwise
// ignored: a restart runs the unit systemd already loaded, and the new text only takes effect
// after a reload nobody asked for.
func (arch) ReloadUnits(ctx context.Context, run Runner) error {
_, err := run(ctx, "systemctl", "daemon-reload")
return err
}