Skip to content

Instantly share code, notes, and snippets.

@joemiller
Created May 1, 2014 14:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemiller/5356ba1ad4277fed8013 to your computer and use it in GitHub Desktop.
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
#!/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