標籤:stat article esc reg 地址 選擇 path class span
78558317
http://man.linuxde.net/chkconfig
1.指令碼編寫1.2.指令碼前三行注釋是註冊服務所必須的,可以改參數,設定好php安裝路徑,項目跟路徑,開機檔案即可
- #!/bin/bash
- #chkconfig:2345 90 10
- #description:activitytask service
- #processname:activitytask
-
- php=/usr/bin/php
- root_path="/vagrant/activity_task/"
- start_file="web_start.php"
- case "$1" in
- start)
- echo ‘starting activity_task web_start.php‘
- echo "$php ${root_path}${start_file} start -d"
- $php ${root_path}${start_file} start -d
- ;;
- stop)
- echo "stoping activity_task...web_start.php"
- echo "$php ${root_path}${start_file} stop"
- $php ${root_path}${start_file} stop
- ;;
-
- status)
- echo "status activity_task...web_start.php"
- echo "$php ${root_path}${start_file} status"
- $php ${root_path}${start_file} status
- ;;
-
- restart)
- echo "restarting activity_task...web_start.php"
- echo "$php ${root_path}${start_file} reload"
- $php ${root_path}${start_file} reload
- ;;
- *)
-
- echo "Usage: $0 {start|stop|restart|restart}"
-
- exit 1
-
- ;;
-
-
- esac
1.2 配置開機自啟動
1.設定檔可執行,chmod +x service_name(假設指令檔命名為service_name)
2.設定服務的運行層級,預設2345.所以選擇預設即可。
chkconfig service_name on
--------------------- 本文來自 帶風帶不走 的CSDN 部落格 ,全文地址請點擊:78558317?utm_source=copy
workman項目設定開機自啟動