Bug 1427806
| Summary: | Rpcbind fails in the systemd container | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Mohamed Ashiq <mliyazud> | ||||||
| Component: | rpcbind | Assignee: | Steve Dickson <steved> | ||||||
| Status: | CLOSED NOTABUG | QA Contact: | Filesystem QE <fs-qe> | ||||||
| Severity: | urgent | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 7.3 | CC: | amurdaca, dwalsh, eguan, hchiramm, jhonce, jiyin, julim, kramdoss, lsm5, mliyazud, pprakash, rcyriac, swhiteho, tsweeney, xzhou, yoyang, zlang | ||||||
| Target Milestone: | rc | Keywords: | Extras | ||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2017-12-07 16:31:20 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Bug Depends On: | |||||||||
| Bug Blocks: | 1422090 | ||||||||
| Attachments: |
|
||||||||
|
Description
Mohamed Ashiq
2017-03-01 09:48:47 UTC
This is part of the Container Native Storage (CNS) initiative for OpenShift. rpcbind is needed in order for Gluster to provide NFS. Note: NFS is a common use scenario for Gluster storage, and this rpcbind issue will need to be resolved in order for containerized Gluster to provide NFS capabilities. Relates to Gluster BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1422090 What is the docker command you are using to start the rpcbind container? Are you doing this in a --privileged container? (In reply to Daniel Walsh from comment #4) > What is the docker command you are using to start the rpcbind container? > Are you doing this in a --privileged container? Yeah, we are using privileged and --net=host. Can you strace the rpcbind to see what is failing? Created attachment 1287946 [details]
Strace without Enabling rpcbind on host
Created attachment 1287947 [details]
Strace after Enabling rpcbind on host
(In reply to Daniel Walsh from comment #6) > Can you strace the rpcbind to see what is failing? Sorry for the delay. I have attached the requested. # docker run -d -v /var/run/rpcbind.sock:/var/run/rpcbind.sock --privileged --net=host -v /sys/fs/cgroup:/sys/fs/cgroup:ro rpcbind-test c8df62a911deef21129f2ea5a008e60fada3095b03eadd15959df55f2dfa437e # docker exec -it c8df62a911deef21129f2ea5a008e60fada3095b03eadd15959df55f2dfa437e bash rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"process_linux.go:75: starting setns process caused \\\"fork/exec /proc/self/exe: no such file or directory\\\"\"\n" Tom can you take a look at this one? Not sure what is going wrong with it. But I would like to see if we can get this running with oci-systemd-hook. I think eliminating the mounting of /sys/fs/cgroup and the volume /sys/fs/cgroup inside of the image would be the first steps. I'll see what I can do with it this afternoon. Hi Mohamed, I'd some trouble with using your Dockerfile from your example. I'd to change the FROM to: FROM rhel:7.3 I also had a little difficulty figuring out exactly what you were doing in your example in comment #9. Below are the steps that I used with the latest and greatest oci-systemd-hook in play. As Dan suggested, I also removed the '/sys/fs/cgroup:/sys/fs/cgroup:ro' parameter from your docker run command. I think things are running ok, but again, I'm not 100% sure if I missed a step or I did something on the container that should have been done on the host. If I've messed something up or you'd like me to test other twists, please let me know. 1) # On Host # systemctl disable rpcbind Removed symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket. # systemctl disable rpcbind.socket # docker run -d -v /tmp/rpcbind:/root:z --privileged --net=host rpcbind-test # docker exec -it 69e24dd93f9e bash # On Container # systemctl start rpcbind # systemctl start rpcbind.socket 2) # On Host # systemctl enable rpcbind Created symlink from /etc/systemd/system/sockets.target.wants/rpcbind.socket to /usr/lib/systemd/system/rpcbind.socket. # systemctl enable rpcbind.socket #On Container # systemctl status rpcbind ● rpcbind.service - RPC bind service Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; indirect; vendor preset: enabled) Active: active (running) since Fri 2017-06-16 21:45:08 UTC; 3min 43s ago Process: 67 ExecStart=/sbin/rpcbind -w $RPCBIND_ARGS (code=exited, status=0/SUCCESS) Main PID: 68 (rpcbind) CGroup: /system.slice/docker-69e24dd93f9e302b2b6494288f3a9d4b8f6b67243f44261f337ac2d7443f1b52.scope/system.slice/rpcbind.service └─68 /sbin/rpcbind -w Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Starting RPC bind service... Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Started RPC bind service. # systemctl status rpcbind.socket ● rpcbind.socket - RPCbind Server Activation Socket Loaded: loaded (/usr/lib/systemd/system/rpcbind.socket; enabled; vendor preset: enabled) Active: active (running) since Fri 2017-06-16 21:43:19 UTC; 5min ago Listen: /var/run/rpcbind.sock (Stream) [::]:111 (Stream) 0.0.0.0:111 (Stream) Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Listening on RPCbind Server Activation Socket. Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Starting RPCbind Server Activation Socket. # journalctl -u rpcbind -- Logs begin at Fri 2017-06-16 21:43:19 UTC, end at Fri 2017-06-16 21:45:11 UTC. -- Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Starting RPC bind service... Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Started RPC bind service. # journalctl -u rpcbind.socket -- Logs begin at Fri 2017-06-16 21:43:19 UTC, end at Fri 2017-06-16 21:45:11 UTC. -- Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Listening on RPCbind Server Activation Socket. Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Starting RPCbind Server Activation Socket. (In reply to Tom Sweeney from comment #14) > Hi Mohamed, > > I'd some trouble with using your Dockerfile from your example. I'd to > change the FROM to: > > FROM rhel:7.3 > > I also had a little difficulty figuring out exactly what you were doing in > your example in comment #9. Below are the steps that I used with the latest > and greatest oci-systemd-hook in play. As Dan suggested, I also removed the > '/sys/fs/cgroup:/sys/fs/cgroup:ro' parameter from your docker run command. > > I think things are running ok, but again, I'm not 100% sure if I missed a > step or I did something on the container that should have been done on the > host. If I've messed something up or you'd like me to test other twists, > please let me know. > > > 1) > # On Host > # systemctl disable rpcbind > Removed symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket. > # systemctl disable rpcbind.socket > # docker run -d -v /tmp/rpcbind:/root:z --privileged --net=host rpcbind-test > # docker exec -it 69e24dd93f9e bash > > # On Container > # systemctl start rpcbind > This should have been started as per my testing too. > # systemctl start rpcbind.socket > > 2) > # On Host > # systemctl enable rpcbind > Created symlink from /etc/systemd/system/sockets.target.wants/rpcbind.socket > to /usr/lib/systemd/system/rpcbind.socket. > # systemctl enable rpcbind.socket > enable does not start the rpcbind right? can you try rpcbind start? then try to start in the container. > #On Container > # systemctl status rpcbind > ● rpcbind.service - RPC bind service > Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; indirect; vendor > preset: enabled) > Active: active (running) since Fri 2017-06-16 21:45:08 UTC; 3min 43s ago > Process: 67 ExecStart=/sbin/rpcbind -w $RPCBIND_ARGS (code=exited, > status=0/SUCCESS) > Main PID: 68 (rpcbind) > CGroup: > /system.slice/docker- > 69e24dd93f9e302b2b6494288f3a9d4b8f6b67243f44261f337ac2d7443f1b52.scope/ > system.slice/rpcbind.service > └─68 /sbin/rpcbind -w > > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Starting RPC bind service... > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Started RPC bind service. > > # systemctl status rpcbind.socket > ● rpcbind.socket - RPCbind Server Activation Socket > Loaded: loaded (/usr/lib/systemd/system/rpcbind.socket; enabled; vendor > preset: enabled) > Active: active (running) since Fri 2017-06-16 21:43:19 UTC; 5min ago > Listen: /var/run/rpcbind.sock (Stream) > [::]:111 (Stream) > 0.0.0.0:111 (Stream) > > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Listening on RPCbind Server > Activation Socket. > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Starting RPCbind Server > Activation Socket. > > # journalctl -u rpcbind > -- Logs begin at Fri 2017-06-16 21:43:19 UTC, end at Fri 2017-06-16 21:45:11 > UTC. -- > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Starting RPC bind service... > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Started RPC bind service. > > # journalctl -u rpcbind.socket > -- Logs begin at Fri 2017-06-16 21:43:19 UTC, end at Fri 2017-06-16 21:45:11 > UTC. -- > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Listening on RPCbind Server > Activation Socket. > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Starting RPCbind Server > Activation Socket. (In reply to Tom Sweeney from comment #14) > Hi Mohamed, > > I'd some trouble with using your Dockerfile from your example. I'd to > change the FROM to: > > FROM rhel:7.3 > > I also had a little difficulty figuring out exactly what you were doing in > your example in comment #9. Below are the steps that I used with the latest > and greatest oci-systemd-hook in play. As Dan suggested, I also removed the > '/sys/fs/cgroup:/sys/fs/cgroup:ro' parameter from your docker run command. > > I think things are running ok, but again, I'm not 100% sure if I missed a > step or I did something on the container that should have been done on the > host. If I've messed something up or you'd like me to test other twists, > please let me know. > > > 1) > # On Host > # systemctl disable rpcbind > Removed symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket. > # systemctl disable rpcbind.socket # docker build -t rpcbind-test . #Didn't include this is previous reply. > # docker run -d -v /tmp/rpcbind:/root:z --privileged --net=host rpcbind-test > # docker exec -it 69e24dd93f9e bash > > # On Container > # systemctl start rpcbind > >This should have been started as per my testing too. Thanks for the verification. > # systemctl start rpcbind.socket > > 2) > # On Host > # systemctl enable rpcbind > Created symlink from /etc/systemd/system/sockets.target.wants/rpcbind.socket > to /usr/lib/systemd/system/rpcbind.socket. > # systemctl enable rpcbind.socket > >enable does not start the rpcbind right? can you try rpcbind start? then try to start in the container. On the host I did this: # systemctl enable rpcbind # systemctl enable rpcbind.socket # systemctl start rpcbind # systemctl start rpcbind.socket and I received a failure on the start. journalctl Jun 29 19:37:26 rhelbz.localdomain systemd[1]: Starting RPCbind Server Activation Socket. -- Subject: Unit rpcbind.socket has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit rpcbind.socket has begun starting up. Jun 29 19:37:26 rhelbz.localdomain polkitd[654]: Unregistered Authentication Agent for unix-process:5082:924233 (system bus name :1.150, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf8) (disconnected from bus) Jun 29 19:40:01 rhelbz.localdomain systemd[1]: Started Session 22 of user root. -- Subject: Unit session-22.scope has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit session-22.scope has finished starting up. -- -- The start-up result is done. If I stop rpcbind and rpcbind.socket in the container and then try again on the host it starts right up. At this point if I try to start them again in the container, it fails there and I see this error in the journalctl -- Unit rpcbind.socket has begun shutting down. Jun 29 23:42:34 rhelbz.localdomain systemd[1]: Cannot add dependency job for unit sys-fs-fuse-connections.mount, ignoring: Unit is masked. Jun 29 23:42:35 rhelbz.localdomain systemd[1]: rpcbind.socket failed to listen on sockets: Address already in use Jun 29 23:42:35 rhelbz.localdomain systemd[1]: Failed to listen on RPCbind Server Activation Socket. -- Subject: Unit rpcbind.socket has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit rpcbind.socket has failed. -- -- The result is failed. Jun 29 23:42:35 rhelbz.localdomain systemd[1]: Dependency failed for RPC bind service. -- Subject: Unit rpcbind.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit rpcbind.service has failed. -- -- The result is dependency. So is this the behaviour that you were seeing and were concerned about Mohamed? It does look like the rpcbind on both the host and the container are trying to bind on the same socket. Dan any thoughts/suggestions? I'll chase this further but as a heads up I'll be out next week on PTO and might not make progress on this until after I return. > #On Container > # systemctl status rpcbind > ● rpcbind.service - RPC bind service > Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; indirect; vendor > preset: enabled) > Active: active (running) since Fri 2017-06-16 21:45:08 UTC; 3min 43s ago > Process: 67 ExecStart=/sbin/rpcbind -w $RPCBIND_ARGS (code=exited, > status=0/SUCCESS) > Main PID: 68 (rpcbind) > CGroup: > /system.slice/docker- > 69e24dd93f9e302b2b6494288f3a9d4b8f6b67243f44261f337ac2d7443f1b52.scope/ > system.slice/rpcbind.service > └─68 /sbin/rpcbind -w > > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Starting RPC bind service... > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Started RPC bind service. > > # systemctl status rpcbind.socket > ● rpcbind.socket - RPCbind Server Activation Socket > Loaded: loaded (/usr/lib/systemd/system/rpcbind.socket; enabled; vendor > preset: enabled) > Active: active (running) since Fri 2017-06-16 21:43:19 UTC; 5min ago > Listen: /var/run/rpcbind.sock (Stream) > [::]:111 (Stream) > 0.0.0.0:111 (Stream) > > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Listening on RPCbind Server > Activation Socket. > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Starting RPCbind Server > Activation Socket. > > # journalctl -u rpcbind > -- Logs begin at Fri 2017-06-16 21:43:19 UTC, end at Fri 2017-06-16 21:45:11 > UTC. -- > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Starting RPC bind service... > Jun 16 21:45:08 rhelbz.localdomain systemd[1]: Started RPC bind service. > > # journalctl -u rpcbind.socket > -- Logs begin at Fri 2017-06-16 21:43:19 UTC, end at Fri 2017-06-16 21:45:11 > UTC. -- > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Listening on RPCbind Server > Activation Socket. > Jun 16 21:43:19 rhelbz.localdomain systemd[1]: Starting RPCbind Server > Activation Socket. Is this still our issue or an issue with rpcbind? I'm not 100% sure, but I think this is an rpcbind issue, not ours. In short rpcbind can only start up in a container if it is not already started on the host and vice versa. It would be good to have one of the rpcbind folks take a look at this to weigh in if there's an issue. That does not sound like a bug to me, since there is only one NFS system, on a host. rpcbind is probably tied to the kernel and having two managing the same kernel is likely to cause conflicts. But i have changed the ownership to see if they have better ideas. Is there a way we can use rpcbind inside the container environment? Our process depends on the rpcbind and if it started on the host it doesn't start in container(I understand this is by design). Is there any way around? or some option that we can use? Stopping the rpcbind.socket on host doesn't seem to solve the problem when I start the container I see the rpcbind.socket being triggered on the host. It would be really helpful If can make this work. Thanks, Mohamed Ashiq (In reply to Daniel Walsh from comment #19) > That does not sound like a bug to me, since there is only one NFS system, on > a host. rpcbind is probably tied to the kernel and having two managing the > same kernel is likely to cause conflicts. But i have changed the ownership > to see if they have better ideas. Thanks for the update. I am able to use rpcbind of host in the container. The problem was having the service depend on the rpcbind process. I removed the requires from service file of my package then It worked fine. able to use the service from container to bind to a port. Thanks a lot for the updates and responses. Thanks, Ashiq. Hi Mohamed, You should be able to use rpcbind inside the container as long as it is not also running on the host that the container is on. To do this, this should work for you: # cat Dockerfile FROM rhel:7.3 ENV container docker RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release RUN yum-config-manager --add=http://pulp-read.dist.stage.ext.phx2.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os/ RUN yum --nogpgcheck -y update; yum install -y strace rpcbind; yum clean all; VOLUME [ "/sys/fs/cgroup/" ] RUN rpm -e gpg-pubkey-2fa658e0-45700c69 RUN rpm -e gpg-pubkey-fd431d51-4ae0493b RUN systemctl enable rpcbind.service CMD ["/usr/sbin/init"] > 1) > # On Host > # systemctl disable rpcbind > Removed symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket. > # systemctl disable rpcbind.socket # docker build -t rpcbind-test . #Didn't include this is previous reply. > # docker run -d -v /tmp/rpcbind:/root:z --privileged --net=host rpcbind-test > # docker exec -it 69e24dd93f9e bash > > # On Container > # systemctl start rpcbind Based on your last response I think you've cobbled stuff together and have it working as you wanted. If so, please close this bugzilla. Thanks for the updates! I would also state that obviously you can only run 1 rpcbind on with the host network... I am not sure what would happen if you ran multiple rpmcbinds with different networks, but I am pretty sure NFS would not like it. |