解决Ubuntu12.04下rpcbind: cannot open '/var/run/rpcbind/rpcbind.xdr' file for reading

不知道怎么回事,实验室的电脑在同学搞过之后,每次启动都报错

rpcbind: cannot open '/run/rpcbind/rpcbind.xdr' file for reading, errno 2 (no such file or directory)

rpcbind: cannot open '/run/rpcbind/portmap.xdr' file for reading, errno 2 (no such file or directory)

如果你的错误是

rpcbind: cannot open '/var/run/rpcbind/rpcbind.xdr' file for reading, errno 2 (no such file or directory)

rpcbind: cannot open '/var/run/rpcbind/portmap.xdr' file for reading, errno 2 (no such file or directory)

那这个解决方法也是一样的

这个错误并没有什么不好的影响,但是每次启动都出现这样的错误还是让人很不爽,这个错误在Debian官网

和Ubuntu的网站上都有人报这个错误,具体的讨论大家可以看如下几个网址:

https://bugs.launchpad.net/ubuntu/+source/rpcbind/+bug/835833

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=645880

https://bugs.launchpad.net/ubuntu/+source/rpcbind/+bug/947638

这里只需要修改/etc/init下面的portmap.conf文件,将其中的的OPTIONS="-w"注释起来

然后加入一行OPTIONS="",然后保存修改就可以了。

因为Ubuntu目前默认的使用upstart进行启动的,所以所使用的启动文件都是放在init目录下,所以在修改文件时要修改这里

,而init.d是由以前的init方式进行启动的,但是目前的ubuntu一般都采用的是upstart启动,所以这个地方改的时候不要修改错了。

之后输入reboot重新启动,就不会再报那两个错误了