Commit:    01ed1f436c4d306c316fc43e3f6b67d28b948027
Author:    krakjoe <joe.watk...@live.co.uk>         Sun, 1 Dec 2013 13:12:51 
+0000
Parents:   800ec7836b3a095869368fb60c81fbd7cf158337
Branches:  PHP-5.6

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=01ed1f436c4d306c316fc43e3f6b67d28b948027

Log:
...

Changed paths:
  M  phpdbg.init.d


Diff:
diff --git a/phpdbg.init.d b/phpdbg.init.d
index 4b69260..1175044 100755
--- a/phpdbg.init.d
+++ b/phpdbg.init.d
@@ -10,10 +10,10 @@ PIDFILE=/var/run/phpdbg.pid
 STDIN=4000
 STDOUT=8000
 ################################################################
-# Either set path to phpdbg here or rely on phpdbg in PATH        #
+# Either set path to phpdbg here or rely on phpdbg in ENV/PATH #
 ################################################################
-if [ "x$PHPDBG" == "x" ]; then
-       PHPDBG=$(which phpdbg)
+if [ "x${PHPDBG}" == "x" ]; then
+       PHPDBG=$(which phpdbg 2>/dev/null)
 fi
 ################################################################
 # Options to pass to phpdbg upon boot                                          
   #
@@ -26,9 +26,36 @@ LOGFILE=/var/log/phpdbg.log
 . /etc/rc.d/init.d/functions
 RETVAL=1
 ################################################################
+insanity()
+{
+       if [ "x${PHPDBG}" == "x" ]; then
+               PHPDBG=$(which phpdbg 2>>/dev/null)
+               if [ $? != 0 ]; then
+                       echo -n $"Fatal: cannot find phpdbg ${PHPDBG}"
+                       echo_failure
+                       echo
+                       return 1
+               fi
+       else
+               if [ ! -x ${PHPDBG} ]; then
+                       echo -n $"Fatal: cannot execute phpdbg ${PHPDBG}"
+                       echo_failure
+                       echo
+                       return 1
+               fi
+       fi
+       
+       return 0
+}
 
 start()
 {
+               insanity
+
+               if [ $? -eq 1 ]; then
+                       return $RETVAL
+               fi
+
         echo -n $"Starting: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} "
         nohup ${PHPDBG} -l${STDIN}/${STDOUT} ${OPTIONS} 2>>${LOGFILE} 
1>/dev/null </dev/null &
         PID=$!
@@ -43,8 +70,15 @@ start()
         [ $RETVAL = 0 ] && touch ${LOCKFILE}
        return $RETVAL
 }
+
 stop()
 {
+               insanity
+
+               if [ $? -eq 1 ]; then
+                       return $RETVAL
+               fi
+               
         if [ -f ${LOCKFILE} ] && [ -f ${PIDFILE} ]
         then
                 echo -n $"Stopping: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} "


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to