Changing the user of SABnzbd (now: root)

Hi.
I am using dietpi trying to replace my synology diskstation and it really runs more and more better.
I installed SABnzbd which runs smooth and i can use and copy the files by samba to my windows-machine. BUT the samba-user dietpi cannot delete or rename files because the files are root/root.
I made chmod/chown but that only worked for the old files because the SABnzbd-user is root.

Is it possible to change that user to dietpi or another user without root-privileges?

Regards
norrin

You can chown entire directories but be careful

#chown -R dietpi:dietpi /dir/to/change

Might have config files in /etc to see if it runs as either root or dietpi

found this
https://vorkbaard.nl/install-the-latest-version-of-sabnzbd-for-multiple-users-on-debian-8/#addusers

Here is the main site, this might help you
https://vorkbaard.nl/install-the-latest-version-of-sabnzbd-for-multiple-users-on-debian-8/

Interesting, I was sure on current DietPi version, sabnzbd runs as user “dietpi”, but indeed we have forgotten it or there is some reason it still runs as root: https://github.com/Fourdee/DietPi/blob/dev/dietpi/dietpi-software#L11319-L11329

Fourdee
Could you have a look, is there some reason or do we need to align it with the other download software titles and can offer an adjusted systemd unit as workaround?

I will open an GitHub issue: https://github.com/Fourdee/DietPi/issues/2172

Ok, i read on the github-issue-thread and it seems you solved it but how can i make the changes? Just updating or do i have to edit sabnzbd.ini?

Please do the following:

systemctl stop sabnzbd
useradd -rM sabnzbd -G dietpi -s /usr/sbin/nologin
cat << _EOF_ > /etc/systemd/system/sabnzbd.service
[Unit]
Description=sabnzbd DietPi

[Service]
User=sabnzbd
Group=dietpi
Type=simple
ExecStart=$(which python) /etc/sabnzbd/SABnzbd.py -f /etc/sabnzbd/sabnzbd.ini

[Install]
WantedBy=multi-user.target
_EOF_
mkdir -p /var/log/sabnzbd
chown -R sabnzbd:dietpi /etc/sabnzbd
chown -R sabnzbd:dietpi /var/log/sabnzbd
G_CONFIG_INJECT 'log_dir =' 'log_dir = /var/log/sabnzbd' /etc/sabnzbd/sabnzbd.ini
G_CONFIG_INJECT 'permissions =' 'permissions = "0775"' /etc/sabnzbd/sabnzbd.ini
systemctl daemon-reload
systemctl start sabnzbd

If there are any attached downloads in download directory still owned by root, then please chown sabnzbd:dietpi them as well.

That should be it, please report back if you face an issue.

Hi.
Back to report that it works and saying thank you.

I had to do the changes with a “sudo”, used the mc for the edit of sabnzbd.ini and had to chown the complete and incomplete-directories like you wrote.
But now it works.
:slight_smile: