Created
May 1, 2014 14:46
-
-
Save joemiller/5356ba1ad4277fed8013 to your computer and use it in GitHub Desktop.
test connection to all running php-fpm's local unix sockets on a host
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
#!/bin/sh | |
for uid in $(ps aux | grep php-fpm | grep master | grep bindings | awk '{print $1}'); do | |
home=$(getent passwd $uid | awk -F: '{print $6}') | |
if echo /dev/null | socat UNIX:$home/run/php-fpm.sock - ; then | |
echo "$home/run/php-fpm.sock connect OK" | |
else | |
echo "$home/run/php-fpm.sock connect ERROR" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment