Daemonusername option not working

Get help, report and discuss bugs.
gapone
Posts: 17
Joined: 23 Apr 2017, 15:49

Daemonusername option not working

Post by gapone » 01 Jan 2019, 08:41

I have debian7 with vpn split tunneling and it has been running great until now. I'm unable to run nzbget as vpn user on boot. Only way to run it with that user is to login with the user and start nzbget. Something has happened with the daemonusername option because it doesn't work anymore. Please help me...

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Daemonusername option not working

Post by hugbug » 01 Jan 2019, 11:58

Does it work when started from terminal (not from boot)?

gapone
Posts: 17
Joined: 23 Apr 2017, 15:49

Re: Daemonusername option not working

Post by gapone » 01 Jan 2019, 14:11

Only if I login with the vpn user

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Daemonusername option not working

Post by hugbug » 01 Jan 2019, 14:54

As documented Daemonusername has effect only when the program is started from root account. My question was if you start nzbget (as daemon) from terminal as root - does the option work?

gapone
Posts: 17
Joined: 23 Apr 2017, 15:49

Re: Daemonusername option not working

Post by gapone » 02 Jan 2019, 14:43

When started as root in daemon mode, it runs it as root user. Confirmed by Nzbget.lock file which is created by root user.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Daemonusername option not working

Post by hugbug » 03 Jan 2019, 00:32

gapone wrote:
02 Jan 2019, 14:43
Confirmed by Nzbget.lock file which is created by root user.
Well, the lock-file is created before changing user.

Better check user of nzbget-process with "ps" or "top" .

gapone
Posts: 17
Joined: 23 Apr 2017, 15:49

Re: Daemonusername option not working

Post by gapone » 03 Jan 2019, 13:47

Running as root with daemonusername=vpn.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Daemonusername option not working

Post by hugbug » 03 Jan 2019, 17:22

Now you can easily test if user switch is working without rebooting the system.

For some reason it doesn't work. Maybe the user name is incorrect? Does the user exist?

Check the option in nzbget.conf to ensure there are no special characters somewhere in the username. Also check if there are multiple entries of option daemonusername in the config file.

gapone
Posts: 17
Joined: 23 Apr 2017, 15:49

Re: Daemonusername option not working

Post by gapone » 04 Jan 2019, 14:36

Username is correct "vpn" and there is vpn user in the system. No special characters and no multiple entries in the config file. It has been working about 14 months and I think it stopped working after v20.

ryan
Posts: 12
Joined: 25 Sep 2019, 21:23

Re: Daemonusername option not working

Post by ryan » 25 Sep 2019, 22:10

I think I'm having a similar issue with DaemonUsername option not working.
I was running version 18 and all was fine.
On the 17th, I updated to version 21.

I have downloaded a few things since updating and it's been okay.
I have DaemonUsername set to osmc (I'm running NZBGet on osmc).
Usermask was set to 1000.

My last "good" download was 2 days ago, and had folder permissions of osmc:osmc and so could be moved or deleted by other programs for post-processing.
Tonight, folder permissions are being created as root:root and so other programs can't move or delete those folders for processing.

ps aux | grep nzbget shows the process running as root.
I've tried chmod +s nzbget and chown osmc:osmc nzbget and that ran into an unrar issue because unrar seems to be root owned too.

I'm not sure why it was working for a week, then stopped working tonight.
My OS hasn't been updated since the middle of August. I haven't updated any other packages.

I've tried updating to 21.1-testing version but the problem remains.
I've tried setting usermask to 0000 and that still created a folder with root:root ownership, but Sonarr could at least move the file out of the folder (but couldn't delete the empty folder afterwards). The file was copied with root:root permissions.

Any idea what happened to make folders get root:root ownership?
Has DaemonUsername stopped working?

NZBGet starts up with a script in /etc/init.d/ and I've had it running successfully that way since version 15 - do I need to start it up differently?

Post Reply

Who is online

Users browsing this forum: No registered users and 50 guests