[Email protected] init.d]# Morephp-FPMD #!/bin/bash-# #php-fpm-this script starts and stops the php-FPM daemin########################################################## ## - theRepresents the default row number for S and K. Start Sequence Number ( -); Turn off the sequence number 15 # # 3 for the RunLevel, if all the default levels do not start, use"-"represents # # # ############################################## ########### #chkconfig:3 - the#description: Php-FPMD is phpfastcgi manager,only forphp# #processname:p hp-Fpm#config:/usr/local/php/etc/php-Fpm.conf#pidfile:/usr/local/php/var/run/php-Fpm.pid#logfile:/usr/local/php/var/log/php-Fpm.log#sourcefunctionLibrary.". /"-run the file./etc/rc.d/init.d/functions#source networking configuration./etc/sysconfig/Network#check that networking are up. [ "$NETWORKING"="No"] && exit0PHPFPM="/USR/LOCAL/PHP/SBIN/PHP-FPM"Prog=$(basename$phpfpm) Php_fpm_config="/usr/local/php/etc/php-fpm.conf"Lockfile=/var/lock/subsys/Phpfpmstart () {[-X $PHPFPM] | | Exit5 [ -F $php _fpm_config]| | Exit6 Echo-N $"starting $prog:"Daemon $phpfpm-c $php _fpm_config retval=$?Echo[$retval-eq0] &&Touch$Lockfilereturn $retval}stop () {Echo-N $"stopping $prog:"Killproc $prog-QUIT retval=$?Echo[$retval-eq0] &&RM-F $Lockfilereturn $retval}restart () {configtest|| Return $?Stop Start}reload () {configtest|| Return $?Echo-N $"Reloading $prog:"Killproc $phpfpm-HUP RETVAL=$?Echo}force_reload () {restart}configtest () {$phpfpm-T-C $php _fpm_config}rh_status () {status $prog}rh_status_q () {rh_status>/dev/NULL 2>&1} Case " $" inchstart) Rh_status_q&& exit0 $1 ;; Stop) Rh_status_q|| Exit0 $1 ;; Restart|configtest) $1 ;; Reload) Rh_status_q|| Exit7 $1 ;; Force-reload) force_reload;; status) Rh_status;; Condrestart|try-restart) rh_status_q|| Exit0 ;; *) Echo$"Usage: $ {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"Exit2Esac
PHP-FPM's startup script