handle SIGTERMS gracefully
This commit is contained in:
parent
ee3c9decf5
commit
dc7e1ba7f1
1 changed files with 6 additions and 1 deletions
|
@ -19,7 +19,12 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
package = pkgs.callPackage ./default.nix { };
|
package = pkgs.callPackage ./default.nix { };
|
||||||
app = pkgs.writeShellScriptBin "app" "${pkgs.merecat}/bin/merecat -n -p 8080 ${package}/share/web";
|
app = pkgs.writeShellScriptBin "app" ''
|
||||||
|
trap 'kill "''${child_pid}"; wait "''${child_pid}";' SIGINT SIGTERM
|
||||||
|
${pkgs.merecat}/bin/merecat -n -p 8080 ${package}/share/web &
|
||||||
|
child_pid="$!"
|
||||||
|
wait "''${child_pid}"
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
formatter = pkgs.nixpkgs-fmt;
|
formatter = pkgs.nixpkgs-fmt;
|
||||||
|
|
Loading…
Reference in a new issue