[linux新手请教]RHEL6.4 rc.local开机不执行

新手上路,请多包涵

请教各位大神,RHEL6.4 rc.local设置自启动重启之后没有执行,在网上查了很多信息也没有解决,下面是已知问题可能出现的相关信息。

1、系统版本

[root@localhost ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Kernel \r on an \m

2、软链接信息

ls -l /etc/rc{3,5}.d/*local*
lrwxrwxrwx. 1 root root 11 8月  30 20:43 /etc/rc3.d/S99local -> ../rc.local
lrwxrwxrwx. 1 root root 11 8月  30 20:43 /etc/rc5.d/S99local -> ../rc.local

3、执行权限

[root@localhost rc.d]# ll /etc/rc.d/rc.local 
-rwxr-xr-x. 1 root root 481 11月 30 16:26 /etc/rc.d/rc.local

4.rc.local内容(隐去部分内容)

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

route add -net 192.168.XX.0 netmask 255.255.255.0 gw 192.168.XX.254
route add -net 192.168.XX.0 netmask 255.255.255.0 gw 192.168.XX.254

mount -t cifs -o user=XXXXX,password=XXXXX //192.168.XX.XX/XXXX_XX /xxx_data

service iptables stop
阅读 2.9k
1 个回答

软连接的不对吧?

/etc/rc3.d/S99local -> ../rc.local 这是指向了/etc/rc.local。

而你显示的是:/etc/rc.d/rc.local

如果中间没有另一个软连接,肯定执行不了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题