我正在尝试仅为版本 4 启动 nfsd 守护进程。需要 2.30 多分钟才能启动。
# time /usr/sbin/rpc.nfsd -d -N 2 -N 3 -V 4.1 8
rpc.nfsd: knfsd is currently down
rpc.nfsd: Writing version string to kernel: -2 -3 +4 +4.1
rpc.nfsd: Created AF_INET TCP socket.
<<< hangs here for more than 2 mins >>>
rpc.nfsd: Created AF_INET6 TCP socket.
real 2m36.016s
user 0m0.001s
sys 0m0.003s
当我用 strace 运行它时,我可以看到它正在等待套接字写入调用()。
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
write(2, "rpc.nfsd: ", 10rpc.nfsd: ) = 10
write(2, "Created AF_INET TCP socket.", 27Created AF_INET TCP socket.) = 27
write(2, "\n", 1
) = 1
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(4, {sa_family=AF_INET, sin_port=htons(2049), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(4, 64) = 0
write(3, "4\n", 2
<<< waiting here for more than 2 mins >>>
) = 2
close(3) = 0
close(4) = 0
有人可以帮助找到根本原因并解决它吗?
更新:当我在 rpc.nfsd 之前启用并启动 rpcbind 服务时,问题得到解决。为什么 NFSv4 需要 rpcbind 服务?