centos 不执行/etc/rc.local 的问题

来源:互联网 发布:罗马2 兵种数据修改 编辑:程序博客网 时间:2024/06/09 18:41

1.权限与链接问题

# ls -lh /etc/rc.local

#正常如下,rc.local就像超链接它应该指向rc.d/rc.local。

lrwxrwxrwx. 1 root root 13 Oct 22  2016 /etc/rc.local -> rc.d/rc.local

#如果和上面不同,执行如下代码

# rm -rf /etc/rc.local

# ln -s /etc/rc.d/rc.local /etc/rc.local


2.无权限

Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure

#chmod +x /etc/rc.d/rc.local


3.路径问题

#如果这条命令不能执行 forever restartall

并且执行:source /etc/rc.local   服务正常运行的话。直接把rc.loca中的命令改为绝对路径

#/usr/bin/forever restartall