forked from mirrors/nixpkgs
nixos/unifi: fix unifi ExecStop= being incompatible with systemd
unifi does not shut down properly when stopped via systemd (it always exits with SIGTERM exit status) because systemd wants stop commands to not exit before the main command is gone and unifi does not comply. the easiest way around this is to have systemd send an ignored signal after the stop command has exited. unifi may still throw exceptions during shutdown, but it *does* exit cleanly as far as systemd is concerned now.
This commit is contained in:
parent
b53c5c4552
commit
300226261f
|
@ -172,9 +172,15 @@ in
|
|||
ExecStart = "${(removeSuffix "\n" cmd)} start";
|
||||
ExecStop = "${(removeSuffix "\n" cmd)} stop";
|
||||
Restart = "on-failure";
|
||||
TimeoutSec = "5min";
|
||||
User = "unifi";
|
||||
UMask = "0077";
|
||||
WorkingDirectory = "${stateDir}";
|
||||
# the stop command exits while the main process is still running, and unifi
|
||||
# wants to manage its own child processes. this means we have to set KillSignal
|
||||
# to something the main process ignores, otherwise every stop will have unifi.service
|
||||
# fail with SIGTERM status.
|
||||
KillSignal = "SIGCONT";
|
||||
|
||||
# Hardening
|
||||
AmbientCapabilities = "";
|
||||
|
|
Loading…
Reference in a new issue