Not Getting the file permission I was expecting - Linux

I have recently moved to Sonarr from Sickrage. I am using Arch Linux and have Sonarr set so that the outputted files are saved to /media/tv; I believe Sonarr refers to this as the “Sorted TV Folder”. I have the group ID of this directory set to “media” (sudo chown -R root:media /media/tv) and setgid flag set (sudo chmod -R 2775 /media/tv). This way any file or directory created in this directory will inherit the group ID. The idea being that users (Sonarr, myself, etc.) that need access to this directory will just need to be added to the media group; provided the group permission are set correctly.

This has worked well for Sickbeard, Sickrage, and CouchPotato in the past as these applications set the user and group permission the same for the files and directories they create by default. Or at least I believe it is by default there may be some setting I changed a while back that I forgot about. This gives me the ability to add myself to the “media” group so I can make changes to these files as needed.

I am trying to get Sonarr to do something similar but I am running into a few issues. By default (Set Permissions = NO) Sonarr does not set the same permission to the users as it does to the group. It uses 755 for directories and 644 for files. I am sure there is a good reason for this; and the Set Permission settings exists so people can change it as desired.

I have try the following settings:

Set Permissions Yes
File chmod mask 0664
Folder chmod mask 2775
chown User sonarr
chown Group media

However I am not getting the result I was expecting. The setgid flag is not being set for the series or season directories; i.e. this directories permission is 0775. Is this a bug or more likely me not understanding what I am doing? Is there a way of having things set to operate the way I would like?

Cheers

To confirm, the issue is the series and season folders aren’t getting the group set properly?

The issue is the setgid flag is not being set on the series and season folders. That is these folder are getting a permission of 0775 where as I would prefer 2775.

Please refer to the following Wikipedia article for information on what I am referring to as the setgid flag.

en.wikipedia.org/wiki/Setgid

Thank you for your help

If the top folder has setgid then all new sub folders should inherit setgid and group.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.