一、添加开机自启服务

在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例):

  1. systemctl enable jenkins.service #设置jenkins服务为自启动服务
  2. systemctl start jenkins.service #启动jenkins服务

二、添加开机自启脚本

在centos7中增加脚本有两种常用的方法,以脚本autostart.sh为例:

  1. #!/bin/bash
  2. #description:开机自启脚本
  3. /usr/local/tomcat/bin/startup.sh #启动tomcat

1、赋予脚本可执行权限(/opt/script/autostart.sh是你的脚本路径)

chmod+x/opt/script/autostart.sh

2、打开/etc/rc.d/rc/local文件,在末尾增加如下内容

/opt/script/autostart.sh

3、在centos7中,/etc/rc.d/rc.local的权限被降低了,所以需要执行如下命令赋予其可执行权限

chmod+x/etc/rc.d/rc.local

centos7如何添加开机启动服务/脚本的更多相关文章

  1. 【centos7】添加开机启动服务/脚本

    一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...

  2. centos7之添加开机启动服务/脚本

    一.添加开机启动脚本 #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to ...

  3. (转) CentOS 7添加开机启动服务/脚本

    CentOS 7添加开机启动服务/脚本 原文:http://blog.csdn.net/wang123459/article/details/79063703 一.添加开机自启服务 在CentOS 7 ...

  4. CentOS7添加开机启动服务/脚本(延用CentOS6方法)

    一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...

  5. CentOS 7添加开机启动服务/脚本

    一.添加开机自启服务 在CentOS 7中添加开机自启服务非常方便,只需要两条命令(以 jenkins 为例):systemctl enable jenkins.service #设置jenkins服 ...

  6. CentOS 7添加开机启动服务脚本

    一.添加开机自启服务 在CentOS 7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务 ...

  7. Linux—添加开机启动(服务/脚本)

    系统启动时需要加载的配置文件 /etc/profile./root/.bash_profile/etc/bashrc./root/.bashrc/etc/profile.d/*.sh./etc/pro ...

  8. Centos7 下添加开机自启动服务和脚本

    1.添加开机自启服务 #设置jenkins服务为自启动服务 systemctl enable jenkins.service #启动jenkins服务 systemctl start jenkins. ...

  9. centos7如何添加开机启动项?

    centos7提供开启服务启动的方式: 1.系统服务管理命令,如果是通过yum安装的软件,开机启动脚本,已经自动创建好了,直接执行如下命令 nginx.service后缀可以省略 systemctl ...

随机推荐

  1. Android 代码混淆 混淆方案

    本篇文章:自己在混淆的时候整理出比较全面的混淆方法,比较实用,自己走过的坑,淌出来的路.请大家不要再走回头路,可能只要我们代码加混淆,一点不对就会导致项目运行崩溃等后果,有许多人发现没有打包运行好好地 ...

  2. swift 实践- 12 -- UIPickerView

    import UIKit class ViewController: UIViewController , UIPickerViewDelegate,UIPickerViewDataSource{ v ...

  3. 【MySql】delete用法

    delete 语句用于删除表中的数据, 基本用法为: delete from 表名称 where 删除条件; 以下是在表 students 中的实例: 删除 id 为 3 的行: delete fro ...

  4. JS跨域ajax访问

    方式1:jsonp解决跨域访问 需要服务和js配合 服务 [WebMethod] public void HelloWorld2(string name) { HttpContext.Current. ...

  5. Confluence 6 连接到 Jira 用户管理的限制

    当你在使用 JIRA 目录为用户目录的时候,请考虑下面的一些限制和建议. 不知道跨平台的多应用单点登录 当你使用 JIRA 为你的目录管理器的时候,系统将不能支持跨平台的单点登录.当 JIRA 用作目 ...

  6. centos7安装laravel

    一. 安装前准备1. 安装screenyum install screen 2. 安装wgetyum install wget 3. 更新yumyum update 4. 安装额外资源库yum ins ...

  7. 安装mysql后在/var/log/mysqld.log 中找不到临时密码

    centos7通过yum装完mysql,使用grep 'temporary password' /var/log/mysqld.log找不到root密码打开mysqld.log中根本没有tempora ...

  8. RFC2119:RFC协议动词含义

    协议地址:http://www.ietf.org/rfc/rfc2119.txt MUST 必须的.通过它描述的对象,是强制要求的.它与REQUIRED和SHALL含义相同. MUST NOT 不允许 ...

  9. 使用asp.net MVC的 HtmlHelper 时遇到的小问题,报错:Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

    异常信息:Templates can be used only with field access, property access, single-dimension array index, or ...

  10. vetur插件提示 [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives错误的解决办法

    错误提示: [vue-language-server] Elements in iteration expect to have 'v-bind:key' directives.Renders the ...