diff options
author | Stanley Sufficool <ssufficool@php.net> | 2014-10-20 21:33:32 -0700 |
---|---|---|
committer | Stanley Sufficool <ssufficool@php.net> | 2014-10-20 21:33:32 -0700 |
commit | 8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch) | |
tree | ed51eb30a2cbc92b102557498fb3e4113da1bb07 /sapi/phpdbg/phpdbg.init.d | |
parent | 9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff) | |
parent | baddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff) | |
download | php-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz |
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits)
Extra comma
Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators
Simplification
zend_get_property_info_quick() cleanup and optimization
initialize lineno before calling compile file file in phar
Use ADDREF instead of DUP, it must be enough.
Removed old irrelevant comment
fixed compilation error
Fix bug #68262: Broken reference across cloned objects
export functions needed for phpdbg
Fixed compilation
Optimized property access handlers. Removed EG(std_property_info).
Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads)
Don't make difference between undefined and unaccessible properies when call __get() and family
Don't make useless CSE
array_pop/array_shift optimization
check for zlib headers as well as lib for mysqlnd
a realpath cache key can be int or float, catching this
News entry for new curl constants
News entry for new curl constants
...
Diffstat (limited to 'sapi/phpdbg/phpdbg.init.d')
-rwxr-xr-x | sapi/phpdbg/phpdbg.init.d | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg.init.d b/sapi/phpdbg/phpdbg.init.d new file mode 100755 index 0000000000..99a1ab328b --- /dev/null +++ b/sapi/phpdbg/phpdbg.init.d @@ -0,0 +1,122 @@ +################################################################ +# File: /etc/init.d/phpdbg # +# Author: krakjoe # +# Purpose: Daemonize phpdbg automatically on boot # +# chkconfig: 2345 07 09 # +# description: Starts, stops and restarts phpdbg daemon # +################################################################ +LOCKFILE=/var/lock/subsys/phpdbg +PIDFILE=/var/run/phpdbg.pid +STDIN=4000 +STDOUT=8000 +################################################################ +# Either set path to phpdbg here or rely on phpdbg in ENV/PATH # +################################################################ +if [ "x${PHPDBG}" == "x" ]; then + PHPDBG=$(which phpdbg 2>/dev/null) +fi +################################################################ +# Options to pass to phpdbg upon boot # +################################################################ +OPTIONS= +LOGFILE=/var/log/phpdbg.log +################################################################ +# STOP EDITING STOP EDITING STOP EDITING STOP EDITING # +################################################################ +. /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=$! + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + echo $PID > $PIDFILE + echo_success + else + echo_failure + fi + echo + [ $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} " + kill -s TERM $(cat $PIDFILE) + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + echo_success + else + echo_failure + fi + echo + [ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE} + else + echo -n $"Error: phpdbg not running" + echo_failure + echo + [ $RETVAL = 1 ] + fi + return $RETVAL +} +################################################################## +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $PHPDBG + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 start|stop|restart|status" + ;; +esac +################################################################### +exit $RETVAL |