💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ## 模版 > [参考](https://gist.github.com/vittee/7262943) <details> <summary>/etc/init.d/php-fpm</summary> ``` #!/bin/bash # # # chkconfig: - 85 15 # description: your description # # processname: php-fpm . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/php-fpm ]; then . /etc/sysconfig/php-fpm fi # 程序自带的守护进程,没有可以不写 BINCTL="" BIN=/home/im_user/im_server/im_webserver/php/sbin/php-fpm PID=$BIN/logs/httpd.pid OPTIONS="" PROG=$(basename ${BIN}) # 存放结果的变量 RETVAL=0 USER="im_user" start() { echo -n $"Starting $PROG: " daemon --user="${USER}" $BIN $OPTIONS RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/${PROG} return $RETVAL } stop() { echo -n $"Stopping $PROG: " killproc $BIN RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/${PROG} $PID } reload() { echo -n $"Reloading $PROG: " killproc $BIN -HUP RETVAL=$? echo } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $BIN RETVAL=$? ;; restart) stop start ;; condrestart) if [ -f $PID ] ; then stop start fi ;; reload) reload ;; ## 扩展,可能有些服务自带守护进程或其他参数 graceful|help|configtest|fullstatus) $BINCTL $@ RETVAL=$? ;; *) echo $"Usage: $PROG {start|stop|restart|condrestart|reload|status" echo $"|fullstatus|graceful|help|configtest}" exit 1 esac exit $RETVAL ``` </details> <br/>