-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7423aa
commit c6be1f0
Showing
3 changed files
with
5 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Exit with code 1 if any php process has been running for more than 1 hour. | ||
if [ $(ps -o time,comm | grep -c '.*h.*php-fpm') -gt 0 ]; then exit 1; fi | ||
# shellcheck disable=SC2009 | ||
if [ "$(ps -o time,comm | grep -c '.*h.*php-fpm')" -gt 0 ]; then exit 1; fi |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/usr/bin/env ash | ||
|
||
# Send a ping request via fcgi. Use an empty environment with `env -i`. | ||
# Send a ping request via fast-cgi. Use an empty environment with `env -i`. | ||
PING_RESPONSE=$(env -i SCRIPT_NAME=/ping SCRIPT_FILENAME=/ping REQUEST_METHOD=GET cgi-fcgi -bind -connect /sock/fpm.sock | tail -1); | ||
|
||
# Exit with code 1 if the ping response was not 'pong'. | ||
if [ "$PING_RESPONSE" != 'pong' ]; then exit 1; fi; | ||
|
||
# Request the fpm status via fcgi. | ||
# Request the fpm status via fast-cgi. | ||
FPM_STATUS=$(env -i SCRIPT_NAME=/status SCRIPT_FILENAME=/status REQUEST_METHOD=GET cgi-fcgi -bind -connect /sock/fpm.sock); | ||
|
||
# Exit with code 1 if the status is 'Could not connect to /sock/fpm.sock'. | ||
if [ $(echo "$FPM_STATUS" | grep -c 'Could not connect') -gt 0 ]; then exit 1; fi; | ||
if [ "$(echo "$FPM_STATUS" | grep -c 'Could not connect')" -gt 0 ]; then exit 1; fi; |
Empty file.