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

[BUG] UMASK does not affect settings.json #272

Closed
1 task done
zwimer opened this issue Jan 7, 2024 · 6 comments
Closed
1 task done

[BUG] UMASK does not affect settings.json #272

zwimer opened this issue Jan 7, 2024 · 6 comments
Labels
work-in-progress Stale exempt

Comments

@zwimer
Copy link

zwimer commented Jan 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When starting the container, settings.json is chmod' 400.

ls -la /path/to/settings.json gives -r--r----- 1 transmission 2852 Jan 7 02:36 seedbox/config/transmission/config/settings.json

Expected Behavior

ls -la /path/to/settings.json should give -rw-r----- 1 transmission 2852 Jan 7 02:36 seedbox/config/transmission/config/settings.json

Steps To Reproduce

In docker compose file set: UMASK=2

chmod g+rw /path/to/settings.json
docker compose up -d
sleep 1
ls -la /path/to/settings.json

Environment

- OS: Fedora 39
- How docker service was installed: dnf

CPU architecture

x86-64

Docker creation

transmission:
    image: "lscr.io/linuxserver/transmission"
    container_name: "transmission"
    restart: always
    stop_grace_period: 2m
    network_mode: "service:vpn"
    depends_on:
      - "vpn"
    ulimits:
      nofile:
        soft: 107374170
        hard: 107374182
    environment:
      - PUID=${TRANSMISSION_UID}
      - PGID=${TRANSMISSION_GID}
      - TZ=${USER_TZ}
      - UMASK=2
      - USER=${TR_USER}
      - PASS=${TR_PASS}
      - HOST_WHITELIST=secret1,secret2
      - PIA_PORT_FILE=34837
    volumes:
      - ${CONFIG}/transmission/config:/config
      - ${TRANSMISSION}:/cryo/transmission

Container logs

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────

ln: failed to create symbolic link '/transmissionic/index.html': File exists
ln: failed to create symbolic link '/combustion-release/index.html': File exists
ln: failed to create symbolic link '/flood-for-transmission/index.html': File exists
ln: failed to create symbolic link '/kettu/index.html': File exists
ln: failed to create symbolic link '/transmission-web-control/index.html': File exists
[custom-init] No custom files found, skipping...
Connection to localhost (127.0.0.1) 9091 port [tcp/*] succeeded!
[ls.io-init] done.
Copy link

github-actions bot commented Jan 7, 2024

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@NarkyAbyss
Copy link

NarkyAbyss commented Jan 10, 2024

the environment variable seems to be ignored completely in my case

/# umask
0022
/# printenv
PUID=100
HOSTNAME=<redacted>
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
UMASK=0011
PWD=/
HOME=/root
PGID=101
VIRTUAL_ENV=/lsiopy
S6_VERBOSITY=1
S6_STAGE2_HOOK=/docker-mods
TERM=xterm
SHLVL=1
PS1=$(whoami)@$(hostname):$(pwd)\$
LSIO_FIRST_PARTY=true
PATH=/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/bin/printenv

the above container was generated with -e UMASK=0011

@LinuxServer-CI
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@zwimer
Copy link
Author

zwimer commented Feb 24, 2024

This issue still exists.

@drizuid drizuid added work-in-progress Stale exempt and removed no-issue-activity labels Feb 25, 2024
@drizuid
Copy link
Member

drizuid commented Feb 25, 2024

i can confirm that this issue exists

this was initially ignored because the OP didn't understand how umask works and was providing incorrect interpretations of chmods. ie, OP stated chmod 400 results in -r--r----- which is false. then claimed it should be -rw-r----- which was also false. Then implied that umask should chmod files, which is further false (umask is a file creation mask, not something that applies to pre-existing files), hence our statement in the container readme to read about umask before seeking support.

with that said, the issue is this, which narky covered in their reply.
providing -e 007 should result in new files being created as 660 and new folders are 770. unfortunately, it doesn't get set.

abc@4873794b7992:/$ umask
0022
abc@4873794b7992:/$ echo $UMASK
007

If i manually bash in and run umask 007 it will work, below test-file is a file that was created prior to manually setting umask, test-file2 is a file created after.

-rw-r--r-- 1 1006 996 0 Feb 25 10:54 test-file  <-- without setting it manually
-rw-rw---- 1 1006 996 0 Feb 25 11:00 test-file2 <-- after setting it manually

test2 is a folder created after setting manually

drwxrwx---  2 1006 996   4096 Feb 25 11:01 test2

we will look into this issue and determine why it is happening.

@benniekiss
Copy link

It looks like this file root/etc/s6-overlay/s6-rc.d/init-transmission-config/run is missing a UMASK section to update the settings.json

uhop added a commit to uhop/docker-transmission that referenced this issue Aug 20, 2024
@drizuid drizuid closed this as completed Nov 13, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress Stale exempt
Projects
Archived in project
Development

No branches or pull requests

5 participants