Unverified Commit 2b959b60 authored by h7x4's avatar h7x4 Committed by GitHub
Browse files

nixos/nats: Shut down gracefully, and prevent automatic restart on deliberate stop (#448023)

parents 01744f36 889b866c
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -138,7 +138,15 @@ in
          Type = "simple";
          ExecStart = "${pkgs.nats-server}/bin/nats-server -c ${configFile}";
          ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
          ExecStop = "${pkgs.coreutils}/bin/kill -SIGINT $MAINPID";

          KillMode = "mixed";
          KillSignal = "SIGUSR2";
          SuccessExitStatus = [
            0
            "SIGUSR2"
          ];

          TimeoutStopSec = "150"; # must exceed lame_duck_duration, which defaults to 2min
          Restart = "on-failure";

          User = cfg.user;