1、赋予脚本可执行权限
chmod +x /etc/init.d/echo.sh
/etc/init.d/echo.sh是我的脚本文件
2、打开/etc/rc.d/rc.local文件,在末尾增加如下内容
echo "/etc/init.d/echo.sh" >> /etc/rc.d/rc.local
3、在centos7中,/etc/rc.d/rc.local的权限被降低了,所以需要执行如下命令赋予其可执行权限
chmod +x /etc/rc.d/rc.local
1、赋予脚本可执行权限
chmod +x /etc/init.d/echo.sh
/etc/init.d/echo.sh是我的脚本文件
2、打开/etc/rc.d/rc.local文件,在末尾增加如下内容
echo "/etc/init.d/echo.sh" >> /etc/rc.d/rc.local
3、在centos7中,/etc/rc.d/rc.local的权限被降低了,所以需要执行如下命令赋予其可执行权限
chmod +x /etc/rc.d/rc.local