stop-php-fpm: no error if FPM pid was not found

This commit is contained in:
Jörg Thalheim 2014-09-23 11:12:26 +02:00
parent cf992e8d8d
commit b620ff03e1

View File

@ -1,8 +1,9 @@
#!/bin/bash
PID=$(cat /run/php-fpm/php-fpm.pid)
PID=$(cat /run/php-fpm/php-fpm.pid 2>/dev/null)
[ "$PID" == "" ] && exit 0
CHILDREN=$(ps -o pid --no-headers --ppid "$PID" | wc -l)
if [ $CHILDREN == "0" ]; then
kill "$PID"
if [ "$CHILDREN" == "0" ]; then
kill "$PID"
fi