开机自启动脚本

方法一:修改rc.local

1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以需要赋予其可执行权
chmod +x /etc/rc.d/rc.local
2、赋予脚本可执行权限
假设/usr/local/script/autostart.sh是你的脚本路径,给予执行权限
chmod +x /usr/local/script/autostart.sh
3、打开/etc/rc.d/rc.local文件,在末尾增加如下内容
/usr/local/script/autostart.sh
posted @ 2019-12-23 10:24  kylingx  阅读(1158)  评论(0编辑  收藏  举报