Changing the user of SABnzbd (now: root)

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?


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

Here is the main site, this might help you

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:

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:

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
Description=sabnzbd DietPi

ExecStart=$(which python) /etc/sabnzbd/ -f /etc/sabnzbd/sabnzbd.ini

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.

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.