forked from troykinsella/ansible-concourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
concourse-worker: add watchdog process
- Loading branch information
Steve Durrheimer
committed
May 29, 2020
1 parent
fb0f13c
commit ec468d4
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# {{ ansible_managed }} | ||
|
||
while(true); do | ||
FAIL=0 | ||
|
||
curl --silent 127.0.0.1:8888 || FAIL=1 | ||
|
||
if [[ $FAIL -eq 0 ]]; then | ||
/bin/systemd-notify "WATCHDOG=1"; | ||
sleep $(({{ concourse_worker_watchdog_sec * 1000000 }} / 2000000)) | ||
else | ||
echo "> $0: FAILURE" | ||
sleep 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters