diff options
Diffstat (limited to 'development/hhvm/etc/rc.hhvm')
-rw-r--r-- | development/hhvm/etc/rc.hhvm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/development/hhvm/etc/rc.hhvm b/development/hhvm/etc/rc.hhvm index 33ab15a7770f8..073e973a03207 100644 --- a/development/hhvm/etc/rc.hhvm +++ b/development/hhvm/etc/rc.hhvm @@ -28,7 +28,7 @@ do_stop () { exit 1 fi - PID=`cat $2` + PID=$(cat $2) kill $1 $PID # Waiting for HHVM to shutdown @@ -37,7 +37,7 @@ do_stop () { if ps -p $PID | grep -q $PID then echo -n . - try=`expr $try + 1` + try=$(expr $try + 1) sleep 1 else try='' @@ -66,7 +66,7 @@ wait_for_pid () { fi echo -n . - try=`expr $try + 1` + try=$(expr $try + 1) sleep 1 done @@ -81,6 +81,9 @@ case "$1" in exit 1 fi + mkdir -p $(dirname ${PIDFILE}) $(dirname ${hhvm_SOCKET}) + chown apache:apache $(dirname ${PIDFILE}) + echo /usr/bin/hhvm --mode daemon $DAEMON_ARGS if [ "$?" != 0 ] @@ -89,7 +92,6 @@ case "$1" in exit 1 fi - mkdir -p `dirname $PIDFILE` wait_for_pid $PIDFILE if [ -n "$try" ] ; then @@ -125,7 +127,7 @@ case "$1" in exit 0 fi - PID=`cat $PIDFILE` + PID=$(cat $PIDFILE) if ps -p $PID | grep -q $PID then echo "HHVM (pid $PID) is running..." @@ -148,7 +150,7 @@ case "$1" in exit 1 fi - kill -USR2 `cat $PIDFILE` + kill -USR2 $(cat $PIDFILE) echo " done" ;; |