Hi everyone,
I've been using Sabnzbd along with Sickbeard for a year or so on my Windows 7 PC. Recently I got myself a nice Raspberry Pi and decided to install Sabnzbd and Sickbeard on it. Everything works great with Sabnzbd and Sickbeard, except the Post-Processing. It is not an issue with Sabnzbd or Sickbeard, but rather a permissions issue that I must figure out how to fix. I hope you can help me, as my Linux knowledge is far less advanced than my Windows knowledge.
I am running Sickbeard and Sabnzbd on their own process user. Sickbeard is running under "sickbeard" and Sabnzbd is running under "sabnzbd". Both users are part of a user group called "media_users". The complete and incomplete folders of Sabnzbd have root:media_users as owners and rwxrwxr-x. When Sabnzbd create files under these folders, they are created as sabnzbd:sabnzbd and rw-rw-r--. Sickbeard then tries to process them (as part of post-processing) and because Sickbeard is running under its own user, he is able to read the files stored in the complete folders, but it cannot delete it. The user sickbeard is considered as "other" on the completed files. It then fails and say that the processing has failed. The file copy worked, it just did not delete the original files into the complete download folder. I have to manually remove the files.
Is there a way to "force" Sabnzbd to create new files with the owners sabnzbd:media_users ? As I said, this might not be a Sabnzbd question but more a Linux question. If media_users can be the group owner of the completed files, Sickbeard's user will be able to delete them because it is part of the group.
I have the same issue with the files that Sickbeard creates when copying. It creates them as sickbeard:sickbeard rw-rw-r-- and I would like them to be created as sickbeard:media_users.
Any ideas how to fix ? I would like to avoid 777 permissions and running all services under the same user.
Thanks !
Neo
Sabnzbd + sickbeard post processing permissions issues
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Re: Sabnzbd + sickbeard post processing permissions issues
not sure if this is the proper way to do it, but I have sabnzbd write out all my files at 777 (sabnzbd:sabnzbd, Config > Folders menu), then have a cron that scrubs through my TV directory and correct everything every night. If you're not familiar with cron, you can just throw the below into a file in /etc/cron.daily/somescript.sh (I call mine Storagecleanup.sh). Be sure to chmod it to be executable by root. You'll obviously need to change your paths and owner/group to match your setup.
Something like that. It's not the cleanest way to do it I'm sure, but it only takes 2-3 seconds to run, and I'm not super concerned with something as trivial as this being perfect.
I'm not aware of any type of ownership umask in Linux, and not finding anything googlin.
Code: Select all
#!/bin/bash
find /Storage/TV \! -perm 770 -exec chmod 770 {} \;
find /Storage/Movies \! -perm 770 -exec chmod 770 {} \;
find /Storage/TV \! -user root \! -group daemons -exec chown root.daemons {} \;
find /Storage/Movies \! -user root \! -group daemons -exec chown root.daemons {} \;
I'm not aware of any type of ownership umask in Linux, and not finding anything googlin.
Re: Sabnzbd + sickbeard post processing permissions issues
A user can be a member of many groups, but files can only have one group owner. Files will be created with ownership set to user:primary_group_of_same_user. So unless you make some group the primary or start a process in such as way that the group is set to something else for the occasion, that's what you'll get. In ubuntu and debian sabnzbd packages, it's possible to use chown syntax (user:group) for the USER setting in /etc/default/sabnzbdplus; other methods such as sudo also provide ways to specify group stuff. Be careful though and read relevant man pages (man start-stop-daemon, man sudo, etc.).