workman項目設定開機自啟動

來源:互聯網
上載者:User

標籤:stat   article   esc   reg   地址   選擇   path   class   span   

78558317

http://man.linuxde.net/chkconfig

1.指令碼編寫1.2.指令碼前三行注釋是註冊服務所必須的,可以改參數,設定好php安裝路徑,項目跟路徑,開機檔案即可
  1.  #!/bin/bash
  2.  #chkconfig:2345 90 10
  3.  #description:activitytask service
  4.  #processname:activitytask
  5.   
  6.  php=/usr/bin/php
  7.  root_path="/vagrant/activity_task/"
  8.  start_file="web_start.php"
  9.  case "$1" in
  10.  start)
  11.  echo ‘starting activity_task web_start.php‘
  12.  echo "$php ${root_path}${start_file} start -d"
  13.  $php ${root_path}${start_file} start -d
  14.  ;;
  15.  stop)
  16.  echo "stoping activity_task...web_start.php"
  17.  echo "$php ${root_path}${start_file} stop"
  18.  $php ${root_path}${start_file} stop
  19.  ;;
  20.   
  21.  status)
  22.  echo "status activity_task...web_start.php"
  23.  echo "$php ${root_path}${start_file} status"
  24.  $php ${root_path}${start_file} status
  25.  ;;
  26.   
  27.  restart)
  28.  echo "restarting activity_task...web_start.php"
  29.  echo "$php ${root_path}${start_file} reload"
  30.  $php ${root_path}${start_file} reload
  31.  ;;
  32.  *)
  33.   
  34.  echo "Usage: $0 {start|stop|restart|restart}"
  35.   
  36.  exit 1
  37.   
  38.  ;;
  39.   
  40.   
  41.  esac
1.2 配置開機自啟動

1.設定檔可執行,chmod +x service_name(假設指令檔命名為service_name)

2.設定服務的運行層級,預設2345.所以選擇預設即可。

chkconfig service_name on 

--------------------- 本文來自 帶風帶不走 的CSDN 部落格 ,全文地址請點擊:78558317?utm_source=copy 

workman項目設定開機自啟動

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.