/etc/rc.local开机自动挂载失败

cck1112 2010-11-16 11:00:40
在/etc/rc.local中添加内容如下:
sh /mnt/mount123.sh

mount123.sh内容如下:
mount -t nfs -o rw 32.74.4.123:mnt/efile/dbbak /mnt/dbbak
mount123.sh有777权限
我手动执行sh /mnt/mount123.sh能够挂载成功

但是当我开机以后自动挂载是失败的,请问这是什么原因?
...全文
1304 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
steptodream 2010-11-16
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 cck1112 的回复:]

在/etc/rc.local中添加内容之后会,/etc/rc.d/rc.local会自动跟/etc/rc.local中内容保持一致
[/Quote]
因为/etc/rc.local是到/etc/rc.d/rc.local的一个软链接而已!
cck1112 2010-11-16
  • 打赏
  • 举报
回复
在/etc/rc.local中添加内容之后会,/etc/rc.d/rc.local会自动跟/etc/rc.local中内容保持一致
ma100 2010-11-16
  • 打赏
  • 举报
回复
etc/rc.d/rc.local
cck1112 2010-11-16
  • 打赏
  • 举报
回复
我在/etc/profile中添加:mount -t nfs -o rw 32.74.4.123:mnt/efile/dbbak /mnt/dbbak
然后在/etc/rc.local中添加:mount -t nfs -o rw 32.74.4.123:mnt/efile/dbbak /mnt/dbbak

机器启动之后便自动挂载上了
不过我不清楚是什么原因?
cck1112 2010-11-16
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 teng0210 的回复:]
/bin/mount -t nfs -o rw 32.74.4.123:mnt/efile/dbbak /mnt/dbbak
rc.local需要绝对路径滴
[/Quote]
在我这里应该不用绝对路径,应为/bin已经添加到PATH环境变量中了
teng0210 2010-11-16
  • 打赏
  • 举报
回复
/bin/mount -t nfs -o rw 32.74.4.123:mnt/efile/dbbak /mnt/dbbak
rc.local需要绝对路径滴
sunlaji008 2010-11-16
  • 打赏
  • 举报
回复
/etc/rc.local是到/etc/rc.d/rc.local的一个软链接

18,829

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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