码迷,mamicode.com
首页 > Web开发 > 详细

php fpm start.sh

时间:2015-08-27 20:41:42      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

#! /bin/bash

#Source function library. 
. /etc/init.d/functions
#Check that networking is up.
. /etc/sysconfig/network

if [ "$NETWORKING" = "no" ]
then
        exit 0
fi

RETVAL=0
prog="/home/admin/local/php54/sbin/php-fpm"
pidfile=${PIDFILE-/home/admin/local/php54/var/run/php-fpm.pid}
lockfile=${LOCKFILE-/home/admin/local/php54/var/run/php-fpm.lock}


start ()
{
    echo -n $"starting $prog: "
    dir=$(dirname ${pidfile})
    [ -d $dir ] || mkdir $dir
    daemon --pidfile ${pidfile} $prog
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch ${lockfile}
}

stop ()
{
    echo -n $"stoping $prog: "
    killproc -p ${pidfile} $prog
    RETVAL=$?
    echo
    if [ $RETVAL -eq 0 ]
    then
        rm -f ${lockfile} ${pidfile}
    fi
}

reload()
{
    echo -n $"reloading $prog: "
    killproc -p ${pidfile} $prog -USR2
    RETVAL=$?
    echo                                                                                                                                                   
}                                                                                                                                                          
                                                                                                                                                           
restart()                                                                                                                                                  
{                                                                                                                                                          
    stop                                                                                                                                                   
    start                                                                                                                                                  
}                                                                                                                                                          
                                                                                                                                                           
case "$1" in                                                                                                                                               
    start)                                                                                                                                                 
        start                                                                                                                                              
        ;;                                                                                                                                                 
    stop)                                                                                                                                                  
        stop                                                                                                                                               
        ;;                                                                                                                                                 
    status)                                                                                                                                                
        status -p ${pidfile} $prog                                                                                                                         
        RETVAL=$?                                                                                                                                          
        ;;                                                                                                                                                 
    restart)                                                                                                                                               
        restart                                                                                                                                            
        ;;                                                                                                                                                 
    reload)                                                                                                                                                
        reload                                                                                                                                             
        ;;                                                                                                                                                 
    *)                                                                                                                                                     
    echo $"usage: $0 {start|stop|status|restart|reload}"                                                                                                   
    RETVAL=2                                                                                                                                               
    ;;                                                                                                                                                     
esac                                                                                                                                                       
                                                                                                                                                           
exit $RETVAL                                                                                                                                               
                               

 

php fpm start.sh

标签:

原文地址:http://www.cnblogs.com/allenhaozi/p/4764423.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!