Skip to content

Commit

Permalink
Make the deploy script kill child processes upon exit
Browse files Browse the repository at this point in the history
This allows aborting the deploy with Ctrl-C.

Fixes infinisil#5.
  • Loading branch information
bjornfor committed Nov 1, 2020
1 parent 2127516 commit b074b81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/deploy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ in {
# TODO: Handle signals to kill the async command
nixus.pkgs.writeScript "deploy" ''
#!${nixus.pkgs.runtimeShell}
trap "echo Received signal, exiting; exit" INT TERM
trap "kill 0" EXIT
${lib.concatMapStrings (node: lib.optionalString node.enabled ''
${node.deployScript} &
Expand Down

0 comments on commit b074b81

Please sign in to comment.