于吉吉的技术博客

建造高性能门户网

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  65 随笔 :: 6 文章 :: 149 评论 :: 0 Trackbacks

nfs安装与配置(debian)
好吧,这个错误浪费了我今天几个小时的时间,必须把它记录下来。
问题是这样的,在启动更新了portmap,exportfs,一些没问题后,在做/etc/init.d/nfs-kernel-server restart 出现

/etc/init.d/nfs-kernel-server start
Exporting directories for NFS kernel daemonexportfs: /etc/exports 
[1]:
Neither 'subtree_check' or 'no_subtree_check' specified for export
"foobar".
  Assuming default behaviour ('no_subtree_check').
  NOTE: this default has changed since nfs-utils version 
1.0.x

.
Starting NFS kernel daemon: nfsd
Not starting: portmap daemon is not running (warning).


警告提示portmap is not running

好吧,检查一下portmap

/home/mnt/index# ps aux | grep portmap
daemon   
31478  0.0  0.0   2052   624 ?        Ss   13:59   0:00 /sbin/portmap


portmap的状态已经是running,在googling后,发现网上有人说是
This is the problem, portmap is not actually running, causing rpc.statd

看来问题还是出现rpc上,最主要的进程rpc.mountd无法启动

好吧,接下来打开/etc/init.d/nfs-kernel-server这个启动脚本进行查看

                 # See if portmap or rpcbind are running
                 (cat </dev/null >/dev/tcp/localhost/
1112>/dev/null
                 RET
=$?
                 if 
[ $RET != 0 ]; then
                     echo
                     log_warning_msg 
"Not starting: portmap daemon is not running"
                     exit 
0
                 fi


看来问题就出来这个,什么叫“/dev/tcp/localhost/111”,还是googling,网上有人说

I find that this is a bashism, but the init-script is marked as a bash script at the
top:
!/bin/bash
再man Bash,发现
Bash, as packaged for Debian, does not support using the /dev/tcp and /dev/udp files

应该很清楚了,如果按照这里的分析,那么我们需要对上面的这个启动脚本进行一下修改就可以完成我们的目的,最直接的就是把exit 0注释掉,另外说一点,这个脚本也有些写得不大合理,既然是log_warning_msg,一个warning,就不应该直接的exit 0


posted on 2011-04-06 17:13 陈于喆 阅读(1787) 评论(1)  编辑  收藏 所属分类: linux安装配置

评论

# re: 在debian安装nfs-server出现的bug处理 2011-04-22 18:07 saicain
今天也遇到了这个问题,随后就开始各种google各种卸载重装。捣腾了n久都没解决,还好现在看到您的solution,真是很lucky, thanks  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: