linux autoload service create

---恢复内容开始---

EXEC="php-fpm"

 

 

 

 


stop()
{
echo "Stoping $EXEC ..."
ps aux | grep "$EXEC" | kill -9 `awk '{print $2}'` >/dev/null 2>&1

usleep 100
echo "Shutting down $EXEC: [ OK ]"
}

start()
{
echo "Starting $EXEC ..."
/usr/local/php/sbin/php-fpm
usleep 100
echo "Starting $EXEC: [ OK ]"
}

restart()
{
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;


esac

exit $?

---恢复内容结束---

posted @ 2016-11-04 22:41  无为有道  阅读(217)  评论(0编辑  收藏  举报