💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ## 模版 php-fpm <details> <summary>/etc/init.d/php-fpm</summary> ``` #!/bin/bash # # # chkconfig: - 85 15 # description: php-fpm server # # processname: php-fpm . /etc/init.d/functions export LD_LIBRARY_PATH=/home/im_user/im_server/im_webserver/common:/home/im_user/im_server/im_server/im_common if [ -f /etc/sysconfig/php-fpm ]; then . /etc/sysconfig/php-fpm fi [[ -e /usr/bin/patchelf ]] && patchelf --set-rpath /home/im_user/im_server/im_webserver/common/ /home/im_user/im_server/im_webserver/php/sbin/php-fpm # 程序自带的守护进程,没有可以不写,如 apachectl 基于 httpd BINCTL="" BIN=/home/im_user/im_server/im_webserver/php/sbin/php-fpm # pid 可通过启动服务器后, 全局 find / -name php-fpm.pid 来查看 PID=/home/im_user/im_server/im_webserver/php/var/run/php-fpm.pid OPTIONS="-p /home/im_user/im_server/im_webserver/php \ -y /home/im_user/im_server/im_webserver/php/etc/php-fpm.conf \ -c /home/im_user/im_server/im_webserver/php/etc/php.ini \ -R " PROG=$(basename ${BIN}) # 存放结果的变量 RETVAL=0 USER="im_user" start() { echo -n $"Starting $PROG: " daemon $BIN $OPTIONS RETVAL=$? [ $RETVAL = 0 ] && touch /var/lock/subsys/${PROG} return $RETVAL } stop() { echo -n $"Stopping $PROG: " kill -QUIT $(cat ${PID}) 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/> 注意必须找到pid的值,否则在 debian 中可能无法停止