servicephp-fpmdoesnotsupportchkconfig

为了php-fpm管理方便,从php安装目录拷贝了启动脚本,更改相应路径,然后执行添加启动服务,出现如下错误。

网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了石拐免费建站欢迎大家使用!

service php-fpm does not support chkconfig

经过多方查找,原来是启动脚本中缺少了下面两行内容:

# 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. 

其中2345是默认启动级别,级别有0-6共7个级别。

 

等级0表示:表示关机

 

等级1表示:单用户模式

 

等级2表示:无网络连接的多用户命令行模式

 

等级3表示:有网络连接的多用户命令行模式

 

等级4表示:不可用

 

等级5表示:带图形界面的多用户模式

 

等级6表示:重新启动

 

15是启动优先级,95是停止优先级,优先级范围是0-100,数字越大,优先级越低。

启动脚本如下:

#!/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 "$1" 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

文章标题:servicephp-fpmdoesnotsupportchkconfig
文章起源:https://www.cdcxhl.com/article26/ieodjg.html

成都网站建设公司_创新互联,为您提供微信小程序电子商务域名注册网页设计公司商城网站品牌网站制作

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都app开发公司