Skip to content

Feat/keep permissions#107

Open
mpalermo73 wants to merge 3 commits into
linuxserver:masterfrom
mpalermo73:feat/keep-permissions
Open

Feat/keep permissions#107
mpalermo73 wants to merge 3 commits into
linuxserver:masterfrom
mpalermo73:feat/keep-permissions

Conversation

@mpalermo73

@mpalermo73 mpalermo73 commented Jun 25, 2026

Copy link
Copy Markdown

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Adds a KEEP_PERMISSIONS environment variable that, when set to true, skips the forced chmod operations the container applies to /config, /run/ddclient-cache, and /config/ddclient.conf on startup and on every inotify-triggered config reload.

Changed files:

  • root/etc/s6-overlay/s6-rc.d/init-ddclient-config/run — skip chmod 700 on /config and /run/ddclient-cache, and chmod 600 on /config/*, when KEEP_PERMISSIONS=true
  • root/etc/s6-overlay/s6-rc.d/svc-inotify/run — skip chmod 600 on /config/ddclient.conf after inotify-detected changes when KEEP_PERMISSIONS=true; the env var is cached before the inotify loop to avoid re-evaluating it on every file-change event

Default behaviour (KEEP_PERMISSIONS unset or any value other than true) is unchanged.

Benefits of this PR and context:

Users running with NFS-mounted /config volumes, custom ACLs, rootless runtimes, or any setup where they own and manage file permissions find that the container silently resets their permissions to 700/600 on every restart and every time ddclient.conf is touched. There is currently no escape hatch short of patching the s6 scripts themselves.

Setting KEEP_PERMISSIONS=true lets these users opt out of the forced permission resets while keeping the safe default for everyone else.

How Has This Been Tested?

Tested locally with a bind-mounted /config directory whose files were set to custom permissions before container start:

  • Without KEEP_PERMISSIONS (default): permissions on /config and ddclient.conf are reset to 700/600 on container start and on each config-file save — confirmed existing behavior is intact.
  • With KEEP_PERMISSIONS=true: permissions on /config, /run/ddclient-cache, and ddclient.conf are left untouched on startup; touching ddclient.conf to trigger the inotify loop also leaves permissions unchanged. ddclient restarts correctly in both cases.

Test environment: Manjaro Linux, Docker, linux/amd64.

Source / References:

  • Community reports of permission resets interfering with NFS and custom ACL setups
  • Docker Mod approach considered but rejected — this is a minimal opt-in flag on core container behaviour, not a plugin concern

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants