CentOS7添加开机启动服务/脚本(延用CentOS6方法)
一、添加开机自启服务
在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例):
systemctl enable jenkins.service #设置jenkins服务为自启动服务
sysstemctl start jenkins.service #启动jenkins服务
二、添加开机自启脚本
在centos7中增加脚本有两种常用的方法,以脚本autostart.sh为例:
#!/bin/bash
#description:开机自启脚本
/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
方法二
1、将脚本移动到/etc/rc.d/init.d目录下
mv /opt/script/autostart.sh /etc/rc.d/init.d
2、增加脚本的可执行权限
chmod +x /etc/rc.d/init.d/autostart.sh
3、添加脚本到开机自动启动项目中
cd /etc/rc.d/init.d
chkconfig --add autostart.sh
chkconfig autostart.sh on
转:http://www.cnblogs.com/startcentos/p/6147444.html
CentOS7添加开机启动服务/脚本(延用CentOS6方法)的更多相关文章
- (转) CentOS 7添加开机启动服务/脚本
CentOS 7添加开机启动服务/脚本 原文:http://blog.csdn.net/wang123459/article/details/79063703 一.添加开机自启服务 在CentOS 7 ...
- 【centos7】添加开机启动服务/脚本
一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...
- centos7之添加开机启动服务/脚本
一.添加开机启动脚本 #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to ...
- centos7如何添加开机启动服务/脚本
一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...
- CentOS 7添加开机启动服务/脚本
一.添加开机自启服务 在CentOS 7中添加开机自启服务非常方便,只需要两条命令(以 jenkins 为例):systemctl enable jenkins.service #设置jenkins服 ...
- CentOS 7添加开机启动服务脚本
一.添加开机自启服务 在CentOS 7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务 ...
- CentOS7添加开机启动服务或脚本
方法一(rc.local) 改方式配置自动启动最为简单,只需要修改rc.local文件 由于在centos7中/etc/rc.d/rc.local的权限被降低了,所以需要赋予其可执行权 chmod + ...
- Linux—添加开机启动(服务/脚本)
系统启动时需要加载的配置文件 /etc/profile./root/.bash_profile/etc/bashrc./root/.bashrc/etc/profile.d/*.sh./etc/pro ...
- Centos7 添加开机启动服务
1.在/usr/lib/systemd/system/下创建服务脚本xxx.service,格式如下: [Unit] Description=Scrapyd After=syslog.target n ...
随机推荐
- 微信小程序app配置指南
//app.json页面 { //页面注册,有几个页面都要在pages里面注册 "pages":[ "pages/index/index", "pag ...
- Jmeter-Maven-Plugin高级应用:Configuring the jvm that the jmeter process runs in
Configuring the jvm that the jmeter process runs in The JMeter Maven plugin will run the JMeter proc ...
- Jquery Types 小结
JavaScript provides several built-in(内置的) datatypes. In addition to those, this page documents virtu ...
- MVC模式下值的传递
公司项目转用MVC开发,故学习总结一下mvc会用到的常用传值方法: 正如大家都熟悉的,MVC路由及运行机制是: 首先,Web 浏览器向服务器发送一条URL 请求,如http:/ ...
- Wide - Residual - Inception Networks for R eal - time O bject D etection
本文的提出了一个WR-inception网络结构.只需更小的内存消耗和更小的计算量. 作者使用了一种微结构,整个宏观网络都是由这个微结构组成. 微结构 微结构的种类如下: 基本的残差结构(3*3,3* ...
- Tomcat启动时选择加载项目
到tomcat\conf\Catalina\localhost下新建文件:myapp.xml 内容如下: <Context path="/myapp" docBase=&qu ...
- [ACM] hdu 1671 Phone List (字典树)
Phone List Problem Description Given a list of phone numbers, determine if it is consistent in the s ...
- js 获取地址栏的值乱码问题
传过去的参数是:(01) 0 6936841 40029 4. 接收的参数的:'(01)%200%206936841%2040029%204'. 因为包含空格,或者中文,就会乱码.要想不乱码,接收的使 ...
- android上进行c/C++开发测试(转)
Android C编程技巧 运行模拟器 emulator -console * 将文件写入到模拟器的userdata.img文件中 adb push *将一个目录拷贝到模拟器中,包括子目录 adb p ...
- 【laravel5.4 + TP5.0】hasOne和belongsTo的区别
1.从字面理解:假如A比B大,那么A hasOne B: B belongsTo A: 2.个人总结: 3.从代码角度: 主要是看你是在哪一个model(模型)中编写这个关联关系,父关联对象就是在父关 ...