Error on trying to run a simple RPC program
There is a bug/feature in recent Linux releases of rpcbind - it is now not active/running after system boot, but should somehow be "socket activated" according to systemctl configuration rpcbind.service file in /usr/lib/systemd/system/:
[Install]
Also=rpcbind.socket
Check this thread on same bug/feature caused Ubuntu issues (https://bugs.launchpad.net/ubuntu/+source/rpcbind/+bug/1558196).
The short answer to yours (ours) issue with rpcbind is - in order to run the RPC server code, do this amendment to systemctrl configuration of your system:
sudo systemctl add-wants multi-user.target rpcbind
Now, the intended way to set rpcbind running is to somehow access /var/run/rpcbind.sock, I would owe much to some Unix/Linux guru that may enlighten me on what RPC server application code shall do in order to achieve this rpcbind "socket activation" effect.
Check whether the service is running using rpcinfo
. Here's what I get.
$ rpcinfo
program version netid address service owner
100000 4 tcp6 ::.0.111 portmapper superuser
100000 3 tcp6 ::.0.111 portmapper superuser
100000 4 udp6 ::.0.111 portmapper superuser
100000 3 udp6 ::.0.111 portmapper superuser
100000 4 tcp 0.0.0.0.0.111 portmapper superuser
100000 3 tcp 0.0.0.0.0.111 portmapper superuser
100000 2 tcp 0.0.0.0.0.111 portmapper superuser
100000 4 udp 0.0.0.0.0.111 portmapper superuser
100000 3 udp 0.0.0.0.0.111 portmapper superuser
100000 2 udp 0.0.0.0.0.111 portmapper superuser
100000 4 local /run/rpcbind.sock portmapper superuser
100000 3 local /run/rpcbind.sock portmapper superuser
24 5 udp 0.0.0.0.3.99 - superuser
24 5 tcp 0.0.0.0.3.100 - superuser
If the service is not running, you have to start it with rpcbind
. On Ubuntu I needed root privileges to run the service.
How to install rpcgen
Type this command on the terminal.
sudo apt-get install rpcbind
but at sometimes the above code won't help you to install rpcgen
.
At that time you have to follow these steps.Then you can easily install it. you should follow this step by step
sudo apt-get update
sudo apt-get install rpcbind
Finally you can check it by using this command rpcinfo
First you check that portmapper is working or not, use rpcinfo
to check it.
If you get any error then install portmap