首页 > CentOS下/etc/rc.local一定是/etc/rc.d/rc.local的软链接吗?我的系统里怎么不是?

CentOS下/etc/rc.local一定是/etc/rc.d/rc.local的软链接吗?我的系统里怎么不是?

今天我测试将/usr/bin/rsync --daemon设置为开机自启动。

我首先是执行了echo "/usr/bin/rsync --daemon" >> /etc/rc.local

重启,发现没有开机启动。

然后echo "/usr/bin/rsync --daemon" >> /etc/rc.d/rc.local这样就OK了。

网上看了下,似乎都说/etc/rc.local/etc/rc.d/rc.local的软链接,但是我一看,我的不是。

是我的系统版本问题吗?

6.2 64位


我遇到的问题是:/etc/rc.local里面有一个没执行,其他都执行了。没执行的是/opt/jira/bin/start-jira.sh,是启动jira用的。


我的CentOS 6.5 32位也不是。貌似debian系列的是的。


ls -al /etc/rc5.d/S99local 看下S99local究竟指向的是 /etc/rc.local 还是 /etc/rc.d/rc.local
如果是/etc/rc.d/rc.local,就自己 ln -sf /etc/rc.d/rc.local /etc/rc.local
别纠结啦。各发行版/etc下的内容都有差异。

update:

http://unix.stackexchange.com/questions/59929/whats-the-difference-between-etc-rc-local-and-etc-init-d-rc-local 根据这里说的, /etc/rc.local/etc/rc.d/rc.local 是不同的。 /etc/rc.d/rc.local 在运行级别为(2, 3, 4, 5) 时都要执行,相当于一个 /etc/rcN.d 下的服务。它在执行时会调用 /etc/rc.local(这可能因各发行版而不同)。因此写在 /etc/rc.d/rc.local是确定被执行的。

【热门文章】
【热门文章】