Skip to content

Commit

Permalink
Don't try to kill a process that already exited
Browse files Browse the repository at this point in the history
  • Loading branch information
robbevp committed Dec 14, 2024
1 parent ccdf118 commit 81e38d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ let
pid=$!
echo $pid > "$PRJ_DATA_DIR/pids/${gName}.pid"
on_stop() {
kill -TERM $pid
if ps -p $pid > /dev/null; then
kill -TERM $pid
fi
rm "$PRJ_DATA_DIR/pids/${gName}.pid"
wait $pid
}
Expand Down

0 comments on commit 81e38d4

Please sign in to comment.