zoukankan      html  css  js  c++  java
  • workman项目设置开机自启动

    https://blog.csdn.net/xxq929604980/article/details/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 博客 ,全文地址请点击:https://blog.csdn.net/xxq929604980/article/details/78558317?utm_source=copy 

  • 相关阅读:
    《一线架构师》之Refined Architecture阶段
    可修改性战术分析
    上周学习总结
    软件质量属性之可修改性
    《信息领域热词分析》实现六种质量属性
    质量属性的六个常见属性应用场景(淘宝篇)
    软件架构师如何工作
    信息领域热词分析
    结合ssh谈MVC架构模式
    PythonCPPJava的异同
  • 原文地址:https://www.cnblogs.com/waw/p/9726221.html
Copyright © 2011-2022 走看看