From b620ff03e1a7f7e287a42a5f4cad2a915d478dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 23 Sep 2014 11:12:26 +0200 Subject: [PATCH] stop-php-fpm: no error if FPM pid was not found --- roles/php/files/stop-php-fpm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/php/files/stop-php-fpm b/roles/php/files/stop-php-fpm index 178e81c..9380e33 100644 --- a/roles/php/files/stop-php-fpm +++ b/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