ansible/roles/php/files/stop-php-fpm

10 lines
195 B
Plaintext
Raw Normal View History

2014-08-21 19:25:40 +00:00
#!/bin/bash
PID=$(cat /run/php-fpm/php-fpm.pid 2>/dev/null)
[ "$PID" == "" ] && exit 0
2014-08-21 19:25:40 +00:00
CHILDREN=$(ps -o pid --no-headers --ppid "$PID" | wc -l)
if [ "$CHILDREN" == "0" ]; then
kill "$PID"
2014-08-21 19:25:40 +00:00
fi