Loading nixos/modules/services/networking/unifi.nix +4 −7 Original line number Diff line number Diff line Loading @@ -160,17 +160,14 @@ in serviceConfig = { Type = "notify"; ExecStart = "${cmd} start"; ExecStop = "${cmd} stop"; ExecStop = [ "${cmd} stop" "${lib.getExe' pkgs.util-linux "waitpid"} -t 30 -e $MAINPID" ]; Restart = "always"; 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 nixos/tests/unifi.nix +11 −0 Original line number Diff line number Diff line Loading @@ -21,8 +21,19 @@ machine.wait_for_unit("unifi.service") machine.wait_for_open_port(8880) machine.succeed("systemctl show unifi.service | grep -q 'ActiveState=active'") machine.succeed("pgrep mongod") status = json.loads(machine.succeed("curl --silent --show-error --fail-with-body http://localhost:8880/status")) assert status["meta"]["rc"] == "ok" machine.succeed("systemctl stop unifi.service") machine.succeed("systemctl show unifi.service | grep -q 'ActiveState=inactive'") machine.fail("pgrep mongod") machine.succeed("systemctl start unifi.service") machine.wait_for_unit("unifi.service") machine.succeed("systemctl show unifi.service | grep -q 'ActiveState=active'") machine.succeed("pgrep mongod") ''; } Loading
nixos/modules/services/networking/unifi.nix +4 −7 Original line number Diff line number Diff line Loading @@ -160,17 +160,14 @@ in serviceConfig = { Type = "notify"; ExecStart = "${cmd} start"; ExecStop = "${cmd} stop"; ExecStop = [ "${cmd} stop" "${lib.getExe' pkgs.util-linux "waitpid"} -t 30 -e $MAINPID" ]; Restart = "always"; 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
nixos/tests/unifi.nix +11 −0 Original line number Diff line number Diff line Loading @@ -21,8 +21,19 @@ machine.wait_for_unit("unifi.service") machine.wait_for_open_port(8880) machine.succeed("systemctl show unifi.service | grep -q 'ActiveState=active'") machine.succeed("pgrep mongod") status = json.loads(machine.succeed("curl --silent --show-error --fail-with-body http://localhost:8880/status")) assert status["meta"]["rc"] == "ok" machine.succeed("systemctl stop unifi.service") machine.succeed("systemctl show unifi.service | grep -q 'ActiveState=inactive'") machine.fail("pgrep mongod") machine.succeed("systemctl start unifi.service") machine.wait_for_unit("unifi.service") machine.succeed("systemctl show unifi.service | grep -q 'ActiveState=active'") machine.succeed("pgrep mongod") ''; }