【问题标题】:How to run rpc in Windows Subsystem for Linux?如何在适用于 Linux 的 Windows 子系统中运行 rpc?
【发布时间】:2021-05-27 02:26:09
【问题描述】:

我想执行一个涉及 RPC 的基本 C 程序。但是,当我尝试在 Ubuntu 18.04 LTS(使用 WSL)上运行它时,出现以下错误:

mugdha@LAPTOP-1ME15EK1:~$ rpcinfo

rpcinfo: can't contact rpcbind: RPC: Remote system error - No such file or directory

Error even though rpbind is installed

【问题讨论】:

  • 请勿发布代码、数据、错误消息等的图片 - 将文本复制或输入到问题中。 How to Ask
  • 仅供参考和更好理解,有many reasons why你不应该为此使用图片

标签: linux windows ubuntu-18.04 windows-subsystem-for-linux rpc


【解决方案1】:

启用rpcbindnfs 服务:

sudo update-rc.d rpcbind enable
sudo update-rc.d nfs-common enable

然后重启rpcbind服务:

sudo service rpcbind restart

【讨论】:

  • 请注意,update-rc.d 对 WSL 没有影响,因为它不会在启动时使用 SysVInit 运行服务。答案是(这是一个老问题),可能只是sudo service rpcbind start。只是提醒一下,提出这个问题的人已经有一个多月没有上过该网站了,很可能他们很久以前就解决了这个问题,或者继续前进。 :-)
【解决方案2】:

尝试查看 pkg 准确安装的路径。

which rpcinfo

这个问题可能与端口有关,当你在 WSL 中启动服务器时,windows 和 linux 共享同一个 localhost。更多请查看端口转发port forwarding

【讨论】:

    猜你喜欢
    • 2019-06-07
    • 1970-01-01
    • 2018-06-09
    • 1970-01-01
    • 1970-01-01
    • 2020-09-14
    • 1970-01-01
    • 2017-12-14
    • 2021-01-23
    相关资源
    最近更新 更多