Skip to content

docker.linuxserver.plex chown -R crosses file system boundaries  #97

Description

@heitbaum

The following code does a chown -R across file system boundaries. Unfortunately neither busybox chown (nor gnu chown) do have -xdev option. The -P option is the default - but doesn’t help as this stops following symbolic links but does allow crossing the file system boundary.

The code can mistakenly reset ownership (that it may not have too)

A few ideas

  • check that there are no filesystems mounted under the $i
  • create a new variable and
    • Set the default option not to do the chown
  • only set ownership of if docker.linuxserver.plex does the mkdir

for i in "$V_config" "$V_data_tvshows" "$V_data_movies" "$V_transcode" "$V_data_photos"; do
if [ ! "$(ls -nd $i | awk '{print $3}')" = "$E_PUID" ]; then
echo "attempting chown ${E_PUID}/${E_PGID} on $i"
chown -R "${E_PUID}":"${E_PGID}" "$i" 2>&1 >/dev/null
echo "chown attempt completed, moving on"
else
echo "skipping chown, make sure the folder $i is accessible by the user ${E_PUID}:${E_PGID}"
fi
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions