We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0c0f87 commit 925c36fCopy full SHA for 925c36f
github_actions_runner_manager.sh
@@ -56,9 +56,18 @@ stop () {
56
exit 2
57
fi
58
59
- echo "Stopping runner"
60
- echo "Stopping runner on $(hostname)" >>$state_path/$LOG_FILE
61
- kill -SIGTERM $(cat $state_path/$PID_FILE)
+ local pid=$(cat $state_path/$PID_FILE)
+
+ # check PID exists
62
+ if ps -p $pid >/dev/null
63
+ then
64
+ echo "Stopping runner"
65
+ echo "Stopping runner on $(hostname)" >>$state_path/$LOG_FILE
66
+ kill -SIGTERM $pid
67
+ else
68
+ echo "Runner already stopped"
69
+ echo "Runner already stopped on $(hostname)" >>$state_path/$LOG_FILE
70
+ fi
71
72
echo "Removing pid file"
73
rm -f $state_path/$PID_FILE
0 commit comments