ericvlog / note

6 stars 1 forks source link

(1) Loss of permissions after Sonarr downloads : radarr #23

Open ericvlog opened 2 years ago

ericvlog commented 2 years ago

Save From : (1) Loss of permissions after Sonarr downloads : radarr

Content

You need to get your whole environment of users, groups and permissions setup correctly. Then it'll just chug along happily. That means run each daemon as its own user, like radarr for Radarr and nzbget for NZBGet. You can probably guess what I'd suggest running Sonarr as. Each of these users should be part of a shared group, like media. Now you setup each of your daemons to run as that user and group, with Docker it is likely a -e UID=123 type option, use id <username> to find the UID/GID.

Now that they're all running as the right user and group, you need to configure them to write files and folders with the right permissions. You want a umask of 002 which means folders get 775 and files get 774. In some Docker run arguments, you set -e UMASK=002, or maybe not. In NZBGet, you can set the user and group and umask. In Radarr/Sonarr, you do the same except instead of umask there is a box for folder and file permissions, which you set to 775 and 664 respectively. And of course, fill in the correct user there too.

Now you've got your daemons running as the right user and group and they're setup to make new files w/ the right permissions and user and group. So you have to clean up your existing permissions.

You want NZBGet's download directory to be owned by nzbget:media with permissions of 775 for folders and 664 for files. You do that w/ chown -R nzbget:media /path/to/nzbgets_stuff and find /path/to/nzbgets_stuff -type f -exec chmod 664 '{}' ';' and find /path/to/nzbgets_stuff -type d -exec chmod 775 '{}' ';'. Repeat this for Sonarr and Radarr, changing the user in the chown command. Your TV directory should be owned by Sonarr, Movies owned by Radarr.

Now that it is all done, they'll all just chug along doing the right thing.

Note