如何在centos7中配置一个开机自启动的脚本
2019-03-25 本文已影响0人
爱睡觉的树
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