Browse Source

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

master
Jörg Thalheim 7 years ago
parent
commit
b620ff03e1
  1. 7
      roles/php/files/stop-php-fpm

7
roles/php/files/stop-php-fpm

@ -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
Loading…
Cancel
Save