In order to PHP-FPM management convenience, copy the boot script from the PHP installation directory, change the corresponding path, and then perform the Add startup service, the following error occurs.
Service PHP-FPM does not support Chkconfig
After multiple lookups, the following two lines are missing from the startup script:
# chkconfig:2345 15 95
# DESCRIPTION:PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation \
# with some additional features useful for sites of any size, especially busier sites.
Where 2345 is the default boot level, with a level of 0-6 and a total of 7 levels.
Level 0 means: shutdown
Level 1 means: Single user mode
Level 2: Multi-user command line mode with no network connection
Level 3 means: Multi-user command line mode with network connection
Level 4 means: not available
Level 5 means: Multi-user mode with graphical interface
Level 6 means: reboot
15 is the start priority, 95 is the stop priority, the priority range is 0-100, the greater the number, the lower the priority.
The startup script is as follows:
#!/bin/bash
# chkconfig:2345 15 95
# DESCRIPTION:PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation \
# with some additional features useful for sites of any size, especially busier sites.
# PROCESSNAME:PHP-FPM
# config:/usr/local/php/etc/php.ini
# Source function library.
. /etc/rc.d/init.d/functions
php_path=/server/php
desc= "PHP-FPM Daemon"
name=php-fpm
daemon= $PHP _path/sbin/$NAME
configfile= $PHP _path/etc/php-fpm.conf
pidfile= $PHP _path/var/run/$NAME. pid
Scriptname=/etc/init.d/$NAME
# Gracefully Exit If the package has been removed.
Test-x $DAEMON | | Exit 0
Rh_start () {
$DAEMON-y $CONFIGFILE | | Echo-n "Already Running"
}
Rh_stop () {
Kill-quit ' Cat $PIDFILE ' | | Echo-n "Not Running"
}
Rh_reload () {
Kill-hup ' Cat $PIDFILE ' | | Echo-n "can ' t reload"
}
Case "$" in
Start
Echo-n "Starting $DESC: $NAME"
Rh_start
echo "."
;;
Stop
Echo-n "Stopping $DESC: $NAME"
Rh_stop
echo "."
;;
Reload
Echo-n "Reloading $DESC configuration ..."
Rh_reload
echo "Reloaded."
;;
Restart
Echo-n "Restarting $DESC: $NAME"
Rh_stop
Sleep 1
Rh_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2
Exit 3
;;
Esac
Exit 0
This article is from the "Jamp" blog, make sure to keep this source http://3619523.blog.51cto.com/3609523/1655954
Service PHP-FPM does not support Chkconfig