Webman在linux上通過service開機自啟動
一、在/etc/init.d下創建webman_app文件,權限777,文件內容如下
#!/bin/sh ### BEGIN INIT INFO # Provides: webman_app # Required-Start: $remote_fs $network # Required-Stop: $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the Webman App Service # Description: starts the Webman App Service ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON="/usr/bin/php /source/html/webman/start.php " case "$1" in start) $DAEMON start -d ;; stop) $DAEMON stop ;; status) $DAEMON status ;; reload) $DAEMON reload ;; *) echo "Usage: $NAME {start|stop|reload|status}" >&2 exit 3 ;; esac
二、在/etc/systemd/system下創建webman_app.service文件,權限777,內容如下
[Unit] Description=Webman App Server After=network.target Wants=network.target [Service] Restart=on-failure RestartSec=5 ExecStart=/etc/init.d/webman_app start PIDFile=/source/html/webman/runtime/webman.pid [Install] WantedBy=multi-user.target
三、配置開機自啟動
# 使配置生效 systemctl daemon-reload # 設置開機自啟動 systemctl enable webman_app.service
備注:請確保各文件中配置的地址正常

浙公網安備 33010602011771號