Skip to content

Commit

Permalink
Fix possible race condition
Browse files Browse the repository at this point in the history
Delete PID_FILE as soon as possible to avoid the new creation
of the PID_FILE (which could happen if the process was started
by monit after first kill and sleep of 14 seconds).
  • Loading branch information
dr0i authored and sol committed Feb 13, 2024
1 parent cea402e commit 30850f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ if [ ! -f $PID_FILE ]; then
kill $PID
else
PID=$(cat $PID_FILE)
rm $PID_FILE
kill $PID
sleep 14
kill -9 $PID
rm $PID_FILE
fi
echo "Going to sleep for 11 seconds. Then lookup the process list for the repo name.
If everything is fine, 'monit' is going to start the $REPO instance ..."
Expand Down

0 comments on commit 30850f7

Please sign in to comment.