SABNZBD / SONARR / CIFS not playing nice together

Status
Not open for further replies.

Alan Smithee

Dabbler
Joined
Feb 24, 2015
Messages
13
I've been through a bunch of HOWTOs and threads on how to work out jail permissions when they need to share a common directory, but I am at a point where I might need a little help.

SABNZBD uses the jailed user id "media" which has a UID of 816. It creates files in directories that SONARR is able to see, move and read (which is good). SONARR puts the file into a directory that I need to be owned by the non-jailed user "nobody" (id 65534). "Nobody" is the default user for CIFS across all CIFS shares, so I need to keep it that way. So even though the jails can share files, I need CIFS to also be able to read/write/update the files created by the jails.

My questions are:
- Is it possible to change the id of who SABNZBD/SONARR is running as? (for example, I'd like it to run as the "nobody" id in the jail as it shares the same id as the non jail user "nobody" and would make CIFS happier.
- I do not want to constantly have to do a chmod / chown for every new directory or file created. (unless that is somehow easily automated)
- I was thinking I could create a non-jail user "media" (816) and force CIFS to that user on that share point (if there is a setting in the "Auxiliary Parameters" of the share point config that would allow it)

Thanks for any help or advice.
 
Last edited:

Bobbyg387

Dabbler
Joined
Jan 31, 2015
Messages
32
I think you could probably follow this guide: https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/

Option 2:
In the jail, add a user with a matching UID as the owner of the data dataset/folders.
  • Code (text):
    1. pw useradd -n USER -u UID -d /nonexistent -s /usr/sbin/nologin
In the jail, change the user the plugin runs as, and change ownership of the data-directory.
  • Code (text):
    1. service PLUGIN onestop
    2. chown -R USER:GROUP /var/db/PLUGIN
    3. sysrc 'PLUGIN_user=USER'
    4. service PLUGIN start
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
yes, you can change who sabnzbd runs as, but I'm not sure if you can make this 'nobody'
'sysrc sabnzbd_user=USER'

I've done your second though with CIFS before. I think I set the share to force anonymous access, then set the anonymous user to a 'media' user (UID 816) I created.

the thread @Bobbyg387 should help.
 

Alan Smithee

Dabbler
Joined
Feb 24, 2015
Messages
13
Thanks for your help. I missed that guide and it turns out it worked perfectly.

I ended up following some of the advice in option 2 and got SABNZBD and SONARR to run as "nobody" in the jails and things seem to be running great now. I can see dirs and files the jails create and CIFS and WEBDAV are happy with the shares.
 
Status
Not open for further replies.
Top