Page 1 of 1

Ubuntu 22.04 - Running Sabnzbd with a different group

Posted: March 9th, 2023, 5:19 pm
by lightenup
I recently moved from nzbget, and found no easy way to have sabnzbd enforce group permissions on new files in the completed folder. Here is a little work around....

Modify the file: /etc/default/sabnzbdplus

Add the GROUP variable, the location does not matter, here is what mine looks like:

Code: Select all

# [required] user or uid of account to run the program as:
USER=sabnzb
GROUP=media
Save and exit.

Next edit /etc/init.d/sabnzbdplus , there is a few changes here so bare with me...

Line 38, add GROUP to the end:

Code: Select all

# these are only accepted from the settings file
unset USER CONFIG HOST PORT EXTRAOPTS GROUP
Line 69, add a new line below like so:

Code: Select all

                [ -n "$EXTRAOPTS" ] && OPTIONS="$OPTIONS $EXTRAOPTS"
                [ -n "$GROUP" ] && CHUID="$USER:$GROUP" || CHUID="$USER"
Finally, on line 80 modify the chuid part like so:

Code: Select all

                log_daemon_msg "Starting $DESC"
                eval start-stop-daemon --start --quiet --chuid "$CHUID" --exec "$DAEMON" -- $OPTIONS
Save and quit

Perform a "systemctl daemon-reload" and finally a "service sabnzbdplus restart"

Hopefully this change can make it into the PPA.

Enjoy!

Re: Ubuntu 22.04 - Running Sabnzbd with a different group

Posted: March 13th, 2023, 10:20 am
by jcfp
Note that it's possible to use chown syntax (user:group) for the USER setting in /etc/default/sabnzbdplus, which is also why the init.d uses ${USER%:*} if it really wants only the user part. Admittedly, it is kind of an undocumented feature as fiddling with these things tends to get newbies in trouble.

Re: Ubuntu 22.04 - Running Sabnzbd with a different group

Posted: November 26th, 2023, 5:19 am
by landog
Folks Ive just found this thread.. thank you!

I want to change sabnzb from running as root to running as my user 'matt' (to resolve the permission issues in the completed folders).

do i simply edit the sabnzbplus file in /etc/default from root to matt?

Anything else i need to do ?