felix-cao / Blog

A little progress a day makes you a big success!
31 stars 4 forks source link

Centos 开机自启动 #66

Open felix-cao opened 6 years ago

felix-cao commented 6 years ago
Create 一个脚本myService.sh
cd /home
touch myService.sh
在脚本中输入启动服务的命令
#!/bin/bash
systemctl start docker
systemctl start jenkins

添加可执行权限

chmod +x ./myService.sh

两种方法自启动

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

/home/myService.sh

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

chmod +x /etc/rc.d/rc.local
felix-cao commented 4 years ago

阿里云镜像部署中应用部署自动化: https://help.aliyun.com/knowledge_detail/38555.html?spm=5176.13394938.0.0.7b7570fcr1kJg4

监控与自动化部署问题 https://help.aliyun.com/knowledge_detail/25971.html?spm=a2c4g.11186631.2.6.51b122dbHzJy3D