diff options
author | Atemu <atemu.main@gmail.com> | 2020-01-02 00:28:46 +0100 |
---|---|---|
committer | Benjamin Staffin <benley@gmail.com> | 2020-01-01 18:28:46 -0500 |
commit | a461f3fa9c44b892d798a3c935e7816d26f45f11 (patch) | |
tree | b27e0f532e2a5928e03849e59aa5f4ac1e6b914b /nixos/modules/virtualisation | |
parent | f4375dd320cda42eae1d721653e673a7ed123317 (diff) |
Consider the exit status of docker run in ExecStop (#76444)
We don't need to stop the container if it already exited sucessfully
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/docker-containers.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/docker-containers.nix b/nixos/modules/virtualisation/docker-containers.nix index 59b0943f591f1..760cb9122a2f5 100644 --- a/nixos/modules/virtualisation/docker-containers.nix +++ b/nixos/modules/virtualisation/docker-containers.nix @@ -186,7 +186,7 @@ let ++ map escapeShellArg container.cmd ); ExecStartPre = "-${pkgs.docker}/bin/docker rm -f %n"; - ExecStop = "${pkgs.docker}/bin/docker stop %n"; + ExecStop = ''${pkgs.bash}/bin/sh -c "[ $SERVICE_RESULT = success ] || ${pkgs.docker}/bin/docker stop %n"''; ExecStopPost = "-${pkgs.docker}/bin/docker rm -f %n"; ### There is no generalized way of supporting `reload` for docker |