docker-nginx icon indicating copy to clipboard operation
docker-nginx copied to clipboard

container is chmodding /config/log to 644 on start

Open tsdragon opened this issue 9 years ago • 1 comments

Hello,

This container seems to want to chmod the /config/log directory to 644 every time it boots, rendering the directory unreadable.

manually chmodding to 755 then starting the container results in the container chmodding it back to 644 and then failing.

examples:

># id docker
uid=911(docker) gid=1010(urf) groups=1010(urf)

># ls -la /mnt/docker/web/
total 12
drwxr-xr-x  7 docker urf  7 Apr 29 06:15 .
drwxrwxr-x 14 docker urf 15 Apr 29 06:14 ..
drwxr-xr-x  2 docker urf  2 Apr 29 06:15 keys
drw-r--r--  4 docker urf  4 Apr 29 06:15 log
drwxrwxr-x  3 docker urf  4 Apr 29 06:15 nginx
drwxr-xr-x  2 docker urf  2 Apr 29 06:15 php
drwxrwxr-x  2 docker urf  3 Apr 29 06:15 www

># chmod 755 /mnt/docker/web/log

># ls -la /mnt/docker/web/
total 12
drwxr-xr-x  7 docker urf  7 Apr 29 06:15 .
drwxrwxr-x 14 docker urf 15 Apr 29 06:14 ..
drwxr-xr-x  2 docker urf  2 Apr 29 06:15 keys
drwxr-xr-x  4 docker urf  4 Apr 29 06:15 log
drwxrwxr-x  3 docker urf  4 Apr 29 06:15 nginx
drwxr-xr-x  2 docker urf  2 Apr 29 06:15 php
drwxrwxr-x  2 docker urf  3 Apr 29 06:15 www

># docker start -a nginx
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _     _ _
         | |___| (_) ___
         | / __| | |/ _ \
         | \__ \ | | (_) |
         |_|___/ |_|\___/
               |_|

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donations/
-------------------------------------
GID/UID
-------------------------------------
User uid:    911
User gid:    1010
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
chmod: cannot read directory '/config/log': Permission denied
[cont-init.d] 20-config: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

>#  ls -la /mnt/docker/web/
total 12
drwxr-xr-x  7 docker urf  7 Apr 29 06:15 .
drwxrwxr-x 14 docker urf 15 Apr 29 06:14 ..
drwxr-xr-x  2 docker urf  2 Apr 29 06:15 keys
drw-r--r--  4 docker urf  4 Apr 29 06:15 log
drwxrwxr-x  3 docker urf  4 Apr 29 06:15 nginx
drwxr-xr-x  2 docker urf  2 Apr 29 06:15 php
drwxrwxr-x  2 docker urf  3 Apr 29 06:15 www

tsdragon avatar Apr 29 '17 06:04 tsdragon

Turns out this issue is cause by the docker config folder being an NFS share that was squashing root. after allowing root access on the share the containers ran with expected behavior.

I don't know why the container needs to be able to run chown/chmod commands as root though, is that really required?

tsdragon avatar Apr 29 '17 07:04 tsdragon