From c4cba0e51f9db45b3faee55e8a5ed6d63c227f92 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Sun, 19 Jun 2016 17:19:31 +0800 Subject: [PATCH] ssh module: ignore exit code when socket activated sshd will at times fail when exiting. When socket activated, this will leave a number of sshd@ service instances in the failed state, so we simply ignore the error code if we are running socket activated. Recommended by upstream: http://systemd-devel.freedesktop.narkive.com/d0eapMCG/socket-activated-sshd-service-showing-up-as-a-failure-when-the-client-connection-fails Fixes: #3279 --- nixos/modules/services/networking/ssh/sshd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index a464733a6a03..f900ef494abf 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -263,6 +263,7 @@ in serviceConfig = { ExecStart = + (optionalString cfg.startWhenNeeded "-") + "${cfgc.package}/bin/sshd " + (optionalString cfg.startWhenNeeded "-i ") + "-f ${pkgs.writeText "sshd_config" cfg.extraConfig}"; KillMode = "process";