Arv-mount is not in daemon mode in Docker container

I have created a Docker image for Arvados-CLI using this Dockerfile. When I start a Docker container and execute arv-mount it doesn’t go into daemon mode.

$ docker run --rm -it --device /dev/fuse --cap-add SYS_ADMIN matmu/arvados-cli:plain bash
root@d26dd015b204:/$ export ARVADOS_API_TOKEN=
root@d26dd015b204:/$ export ARVADOS_API_HOST=
root@d26dd015b204:/$ mkdir arv
root@d26dd015b204:/$ arv-mount --debug /arv
2021-04-06 12:15:30 arvados.arv-mount[7] DEBUG: arv-mount debugging enabled
2021-04-06 12:15:30 arvados.arv-mount[7] INFO: /usr/bin/arv-mount 2.0.4 started
2021-04-06 12:15:30 arvados.arv-mount[7] INFO: enable write is False
2021-04-06 12:15:31 arvados.arvados_fuse[7] DEBUG: InodeCache touched inode 5 (size 0) (uuid arlog-tpzed-eqale4azb9x1nnu) total now 0 (1 entries)
FUSE library version: 2.9.9

If I try a it with a local Arvados CLI installation, it does. In the help section it says:

--foreground Run in foreground (default is to daemonize unless --exec specified)

I couldn’t find any parameter for daemon. Also removing --debug doesn’t change anything.

Hi @matmu

Does it still otherwise work as expected, and the problem is just that it doesn’t go into the background? I think what might be happening here is that the bash shell inside the Docker container is pid 1, and the normal behavior of a daemon is to disassociate from the invoking process and attach itself to pid 1. So because it is already invoked by pid 1, it determines that it has nothing to do and stays in the foreground.

1 Like

Dear @tetron,

thanks for this hint. It goes into the background with

docker run --pid=host --rm -it --device /dev/fuse --cap-add SYS_ADMIN matmu/arvados-cli:plain bash
1 Like