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

workman项目设置开机自启动的更多相关文章

  1. Fedora 16设置开机自启动程序与Ubuntu的区别

    Ubuntu设置开机自启动脚本的方法是:修改/etc/init.d/rc.local这个文件,添加需要启动的程序即可,相关函数如下: void SetSysAutoBoot() { ] = {}; ; ...

  2. linux_设置开机自启动程序脚本

    设置开机自启动

  3. Linux服务器,服务管理--systemctl命令详解,设置开机自启动

    Linux服务器,服务管理--systemctl命令详解,设置开机自启动 syetemclt就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了. 摘要: syst ...

  4. CentOS 6下 Oracle11gR2 设置开机自启动

    [1] 更改/etc/oratab # This file is used by ORACLE utilities. It is created by root.sh # and updated by ...

  5. Ubuntu14.04设置开机自启动脚本

    方法一.编辑rc.loacl脚本  Ubuntu开机之后会执行/etc/rc.local文件中的脚本,所以我们可以直接在/etc/rc.local中添加启动脚本.在 exit 0 前面添加好脚本代码, ...

  6. 设置开机自启动VirtualBox虚拟机系统

    如果常用VirtualBox虚拟机系统的话,设置个随开机启动也是很方便的.不需要打开VirtualBox窗口,直接就是系统启动了. 又继续上网搜索学习了.(设置开机自启动VirtualBox虚拟机系统 ...

  7. CentOS7设置开机自启动命令大全

    任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd  on              systemctl enable httpd.service 使某服务不自 ...

  8. ntp服务设置开机自启动失败

    设置了ntpd开机自启动,重启服务器ntpd没有自启动 1.需要禁掉chronyd.service: systemctl disable chronyd.service 2.手动启动ntpd: sys ...

  9. CentOS7设置开机自启动方式

    方式一: # 在/etc/rc.d/rc.local文件中追加启动命令,该文件追加后,会随着机器自动后,自动运行文件中的命令 # vim /etc/rc.d/rc.local # 权限问题:在cent ...

随机推荐

  1. Deepin 系统下安装VMware并激活

    1.打开深度商店:搜索VMware,并下载安装. 2.打开启动器:点击VMware-install. 3.填写管理员密码. 4.下一步,完成安装. 5.打开VMware Workstation,输入密 ...

  2. 电子商务(电销)平台中订单模块(Order)数据库设计明细(转)

    以下是自己在电子商务系统设计中的订单模块的数据库设计经验总结,而今发表出来一起分享,如有不当,欢迎跟帖讨论~ 订单表 (order)|-- 自动编号(order_id, 自增长主键)|-- 订单单号( ...

  3. Halcon 彩色图片通道分割处理

    1.RGB通道:R红色,G绿色,B蓝色:R.G.B各占一个字节,取值范围在0—255:可代表的颜色数256*256*256==2^24 黑色区域是:R=G=B=0;   白色区域是:R=G=B=255 ...

  4. 框架源码系列三:手写Spring AOP(AOP分析、AOP概念学习、切面实现、织入实现)

    一.AOP分析 问题1:AOP是什么? Aspect Oriented Programming 面向切面编程,在不改变类的代码的情况下,对类方法进行功能增强. 问题2:我们需要做什么? 在我们的框架中 ...

  5. C# 移除Response Header,403调整返回为404Make IIS return a 404 status code instead of 403

    Server Information Revealed For the benefit of those who land here through a google/bing search:: He ...

  6. OEL的下载

    https://edelivery.oracle.com 注意的是:第一次下载安装的时候需要首先安装installer.exe软件,然后再下载即可.

  7. linux下用php将doc、ppt转图片

    解决方案分成两步: (1)调用unoconv命令将 doc.ppt 转 pdf (2)使用 imagemagick将 pdf 转图片 步骤 1.安装unoconv sudo apt-get insta ...

  8. [Ubuntu] Git可视化比较工具 P4Merge 的安装/配置及使用

    1 下载 下载地址. 链接到上面的下载页后,先找到左边导航的 Clients ,如下图 1 所示. 接着找到 P4Merge: Visual Merge Tool , 如下图 2 所示. 最后,选择好 ...

  9. PXC 57 二进制安装

    1.准备阶段 1.1 在三个节点上分别创建:用户组 用户组 目录 --用户组 用户组 #/usr/sbin/groupadd mysql #/usr/sbin/useradd -g mysql mys ...

  10. Nginx子域名配置

    extends:http://blog.csdn.net/xiaoping0915/article/details/53899465 ,http://www.myhack58.com/Article/ ...