CentOS 7开机启动脚本

在/etc/rc.d/init.d这个文件中输入的命令在开机时会执行,所以如果只是简单语句可以直接写进去,如果是个脚本,就可以通过这个文件去调用你自己的脚本,经过尝试,结果开机并没有执行,然后发现了文件中的这句话:

# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

ls -l一下发现确实缺少执行权限,于是执行chmod +x /etc/rc.d/rc.local后再重启便成功了。

posted @ 2014-12-02 16:32  benbenizhuzhu  阅读(3260)  评论(0编辑  收藏  举报