Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containers with nfs mounts require manual start of rpc-statd.service #1131

Open
osc86 opened this issue Mar 18, 2022 · 3 comments
Open

Containers with nfs mounts require manual start of rpc-statd.service #1131

osc86 opened this issue Mar 18, 2022 · 3 comments

Comments

@osc86
Copy link

osc86 commented Mar 18, 2022

Describe the enhancement
I'm not sure if this is a bug or if I'm missing something here, but containers that have nfs mounts won't start unless rpc-statd.service is started manually.
Manually mounting a nfs share from the command line works as expected, rpc-statd.service get's started automatically.
Mounting nfs shares using docker should behave the same way, so containers can succesfully start at boot and don't require user intervention.

System details

  • Proxmox / QEMU
  • Fedora CoreOS version 35.20220227.3.0
@dustymabe
Copy link
Member

I guess this depends on a few different factors. I found an old Container Linux bug that touches on a similar topic.

I guess one workaround is for you to just configure rpc-statd.service to be enabled on boot, but in the interest of figuring out the problem, could you provide a very simple reproducer (single docker container preferably) that shows the problem and we can play around with it.

@dustymabe
Copy link
Member

This stackoverflow page also touches on the topic (though it targets CentOS).

@osc86
Copy link
Author

osc86 commented Mar 28, 2022

Thank you for your reply.
It's easy to reproduce, you only need a nfs server, in my case I use openbsd.

See my example /etc/exports:
# cat /etc/exports
/media -alldirs -ro -network=192.168.66.0 -mask=255.255.255.0

Create a new volume:
$ docker volume create --driver local --opt type=nfs --opt o=addr=192.168.66.2,rw,vers=3 --opt device=:/media nfs_test
nfs_test

Try to mount the volume inside a container:
$ docker run -it --mount source=nfs_test,target=/mnt debian /bin/bash
Unable to find image 'debian:latest' locally
latest: Pulling from library/debian
5492f66d2700: Pull complete
Digest: sha256:b42494c466d101bf06038e959e2e5acd227e1251987e79528e7d8b1f4040deaf
Status: Downloaded newer image for debian:latest
docker: Error response from daemon: failed to mount local volume: mount :/media:/var/lib/docker/volumes/nfs_test/_data, data: addr=192.168.66.2,vers=3: connection refused.
See 'docker run --help'.

The error message is misleading.. start rpc-statd.service
$ sudo systemctl start rpc-statd.service
$ docker run -it --mount source=nfs_test,target=/mnt debian /bin/bash
root@dd876c6ce486:/# ls /mnt
Video tmp

So without starting the service, mounting nfs shares using docker volumes will fail. Containers using these volumes are not able to start automatically at boot. It would be great if this could be fixed, without having to mess with systemd services in the ignition file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants