Why does Sabnzbd keep taking back ownership of its' folder?

Get help with all aspects of SABnzbd
Forum rules
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.
Post Reply
road hazard
Newbie
Newbie
Posts: 12
Joined: August 10th, 2019, 8:48 pm

Why does Sabnzbd keep taking back ownership of its' folder?

Post by road hazard »

Using Sabnzbd v2.3.9 [03c10dc] (installed from the AUR)
Endeavour OS (Arch based)
Cinnamon desktop

Been using Linux for a few years and maybe I'm still too much of a newbie to solve this problem but here's the situation. When I installed Sab, I did:

Code: Select all

sudo chown -R roadhazard:roadhazard /opt/sabnzbd/
Then, I created /usr/lib/systemd/system/sabnzbd.service.d/override.conf

Inside that conf file I have:

Code: Select all

[Service]
User=roadhazard
Group=roadhazard
The goal is, I want to run Sabnzbd under my account. When I first did all this, everything worked PERFECTLY. But after the first reboot, /opt/sabnzbd was owned by Sabnzbd again and it couldn't write to my download directory (in my home folder). I issues the command to take ownership of /opt/sabnzbd again and then things sorta started working except Sab was complaining that it couldn't make some INI backup file in its' directory.

Why (how?) is Sabnzbd taking ownership of it's folder after every reboot. I don't think I've seen this with any other program. With Sonarr, I'm using an override file to run it under my account and I have ownership of its' folders and it doesn't do that.

What am I doing wrong here?
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Why does Sabnzbd keep taking back ownership of its' folder?

Post by sander »

I don't understand why it happens, but/and I would say: Avoid that SABnzbd can take ownership by setting the rwx rights to only roadhazard, and no rights for groups and world.
road hazard
Newbie
Newbie
Posts: 12
Joined: August 10th, 2019, 8:48 pm

Re: Why does Sabnzbd keep taking back ownership of its' folder?

Post by road hazard »

sander wrote: August 11th, 2019, 5:40 am I don't understand why it happens, but/and I would say: Avoid that SABnzbd can take ownership by setting the rwx rights to only roadhazard, and no rights for groups and world.
Not sure I follow you. I was screwing around some more with it this morning and if I go back to using the override.conf file and running it under my account, I keep getting errors about 'Cannot create backup file for /opt/sabnzbd/sabnzbd.ini.bak'. I'm sure this is because the /opt/sabnzbd folder keeps reverting ownership back to the account, sabnzbd. I created an audit rule to watch for chown access on /opt/sabnzbd but see nothing that is switching the ownership back to the sabnzbd account yet something is doing it.

Running it under my account, downloaded/rename files are owned by roadhazard (which is good) and are placed in the right directory /mnt/tv/blah blah blah but in Sonarr, I get this error:

Code: Select all

MediaFileAttributeService	Unable to apply permissions to: /mnt/tv/The Real Housewives of Beverly Hills/Season 9/The Real Housewives of Beverly Hills - S09E05 - The Proof Hurts WEBDL-720p.mkv: Error setting file permissions: EPERM

Exception

NzbDrone.Mono.Disk.LinuxPermissionsException: Error setting file permissions: EPERM
  at NzbDrone.Mono.Disk.DiskProvider.SetPermissions (System.String path, System.String mask) [0x0003d] in b81596df5dc24e8a9110ca1cc8a9cd00>:0 
  at NzbDrone.Mono.Disk.DiskProvider.SetPermissions (System.String path, System.String mask, System.String user, System.String group) [0x00000] in <b81596df5dc24e8a9110ca1cc8a9cd00>:0 
  at NzbDrone.Core.MediaFiles.MediaFileAttributeService.SetMonoPermissions (System.String path, System.String permissions) [0x0002d] in <6a3dcbc5b3c2463890627fff9fca65cd>:0 
Despite the error from Sonarr, the file is owned by roadhazard and Plex can delete the episode just fine and it's named correctly. Umask is 002 across the system. SAB and Sonarr are configured so all finished files/folders have 777 access...... I'm stumped.
Post Reply