Skip to content

Commit

Permalink
processes: don't use state to track PID
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Mar 21, 2024
1 parent 57e4a14 commit 47363a7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/modules/processes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,18 @@ in
mkdir -p "$DEVENV_STATE"
fi
backgroundPID=$!
stop_up() {
echo "Stopping processes..."
kill -TERM $(cat "$DEVENV_STATE/devenv.pid")
rm "$DEVENV_STATE/devenv.pid"
wait
kill -TERM $backgroundPID
wait $backgroundPID
${config.process.after}
echo "Processes stopped."
}
trap stop_up SIGINT SIGTERM
echo $! > "$DEVENV_STATE/devenv.pid"
wait
'';

Expand Down

0 comments on commit 47363a7

Please sign in to comment.