在线求助!!rc.local文件不执行(100分)

carlsea 2010-11-27 09:32:17
我在rc.local 增加了几条命令 开机的时候都不执行


执行/etc/rc.local 没有问题,主要问题就是开机貌似不执行rc.local
...全文
3383 67 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
67 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuanzhou08 2013-07-03
  • 打赏
  • 举报
回复
我也遇到了这个问题,网上搜的有说sh -e的问题;软件连接的问题;路径的问题,我这次是因为fc9 2.6.25版本linux默认不启动rc.local,将K99local改成Sxxlocal,让其默认启动就好了。
YoutYu 2013-04-12
  • 打赏
  • 举报
回复
排除万难,出现的问题解决了。竟然所有命令都要用绝对路径,那个touch也要写成/bin/touch
nbafeifeixu 2012-08-28
  • 打赏
  • 举报
回复
本人情况完全一样,正在寻找解决方案。
jesslouying 2012-06-26
  • 打赏
  • 举报
回复
我的情况和lz一样。所以的需要测试的手段都用过了,全正常的。手动执行rc.local正常,文件权限755root,软连接也都有,就是开机不会启动。centos6.2 minimal安装的。
jeeyoo1 2012-03-30
  • 打赏
  • 举报
回复
这真是个奇怪的问题。
我现在也碰到了
我的系统是

[root@vpnserver rc.d]# cat /etc/issue
CentOS release 6.2 (Final)
Kernel \r on an \m

我的脚本是 :


[root@vpnserver rc.d]# cat /etc/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.

export PATH=/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
echo 'nameserver 211.137.191.26' > /etc/resolv.conf
route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.68.11.254 dev eth0
touch /var/lock/subsys/local

脚本rc.local不会执行。。。。
wangzi851011 2011-08-02
  • 打赏
  • 举报
回复
果然老道
fateand 2011-07-28
  • 打赏
  • 举报
回复
bash -x /etc/rc.local
source /etc/rc.local
lq2003 2011-07-21
  • 打赏
  • 举报
回复
俺也遇到此类问题了 !

应该是环境变量问题。
hawk198 2011-01-10
  • 打赏
  • 举报
回复
先别把rc.local搞那么复杂,随便echo一段话,看看能不能成功,然后再看看是不是shell链接错了,还是root的环境变量有问题
电灯泡 2010-12-06
  • 打赏
  • 举报
回复
论战过程太激烈了,俺纯粹打酱油的,但也学了点东西
qlzhou 2010-12-02
  • 打赏
  • 举报
回复
参考http://blog.163.com/lgh_2002/blog/static/44017526201032803748503/
希望对你有所帮助
qlzhou 2010-12-01
  • 打赏
  • 举报
回复
我想在rc.local中改网卡MAC地址也不成功

一起追寻答案
carlsea 2010-12-01
  • 打赏
  • 举报
回复
问题还没解决,继续等待
baocuo1314 2010-11-29
  • 打赏
  • 举报
回复
[Quote=引用 52 楼 steptodream 的回复:]

I'm dead.
[/Quote]

荡漾的主席 倒在前线上了。。。
carlsea 2010-11-27
  • 打赏
  • 举报
回复
还是不行,真晕啊
steptodream 2010-11-27
  • 打赏
  • 举报
回复
I'm dead.
carlsea 2010-11-27
  • 打赏
  • 举报
回复
[Quote=引用 50 楼 steptodream 的回复:]

干脆把链接全部删除了,在重建软连接
-----------

cat /etc/rc3.d/S99local
cat /etc/rc5.d/S99local
看看啊
[/Quote]
[root@localhost ~]# cat /etc/rc3.d/S99local
#!/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
/etc/mbx2009d.sh &
/etc/init.d/pptpd start
ifconfig eth0:0 192.168.55.1 up
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.55.0/24 -j MASQUERADE

[root@localhost ~]#

[root@localhost ~]# cat /etc/rc5.d/S99local
#!/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
/etc/mbx2009d.sh &
/etc/init.d/pptpd start
ifconfig eth0:0 192.168.55.1 up
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.55.0/24 -j MASQUERADE

[root@localhost ~]#

steptodream 2010-11-27
  • 打赏
  • 举报
回复
干脆把链接全部删除了,在重建软连接
-----------

cat /etc/rc3.d/S99local
cat /etc/rc5.d/S99local
看看啊
freetstar 2010-11-27
  • 打赏
  • 举报
回复
一个个脚本来试试吧。。
carlsea 2010-11-27
  • 打赏
  • 举报
回复
[Quote=引用 46 楼 steptodream 的回复:]

rc.local文件 本身的文件是在/etc/rc.d/rc.local

/etc/rc.local是一个到/etc/rc.d/rc.local的软连接

/etc/rc3.d/S99local
/etc/rc5.d/S99local
这2个又分别是到/etc/rc.local的软连接

你一会确认一下
/etc/rc3.d/S99local
/etc/rc5.d/S99l……
[/Quote]
干脆把链接全部删除了,在重建软连接
加载更多回复(47)

19,619

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧