Centos6-7的开机流程

Centos6

Centos7

自启动脚本的一种方法

方法一

1、赋予脚本可执行权限(/opt/scripts/test.sh是你的脚本路径)
chmod +x /opt/scripts/test.sh

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

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

posted on 2021-09-09 20:05  lodger47  阅读(36)  评论(0)    收藏  举报

导航