nzbget asks for username/password when run from upstart

Get help, report and discuss bugs.
Post Reply
void.pointer
Posts: 60
Joined: 28 Sep 2014, 20:58

nzbget asks for username/password when run from upstart

Post by void.pointer » 05 May 2015, 00:01

I have the following upstart script for Ubuntu Server v14:

Code: Select all

description "NZBGet upstart script"

#setuid pi
#setgid pi

start on runlevel [2345]
stop on runlevel [016]

respawn

expect fork

script
    exec nzbget -D
end script

pre-stop script
    exec nzbget -Q
end script
I verify the process is running:

Code: Select all

robert@nami:/etc/init$ ps aux | grep nzb
root      1901  0.0  0.0 282820  2392 ?        Ssl  18:54   0:00 nzbget -D
However when I visit the page, I get a username/password popup dialog. I do NOT have a username or password requirement in my nzbget configuration settings. Interestingly, if I run nzbget manually by doing this:

Code: Select all

sudo /usr/local/bin/nzbget -D
I'm able to get to it just fine. I compiled and installed nzbget myself via the following:

Code: Select all

$ svn update
$ ./configure
$ make
$ sudo make install
Can anyone help me understand why nzbget won't work when started from upstart?

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

Re: nzbget asks for username/password when run from upstart

Post by hugbug » 05 May 2015, 05:26

You must have two config files and different files are used depending on how it is started. Add -c /path/to/nzbget.conf to be sure which config to use in all cases.

void.pointer
Posts: 60
Joined: 28 Sep 2014, 20:58

Re: nzbget asks for username/password when run from upstart

Post by void.pointer » 05 May 2015, 11:49

Is there a way to see which config is loaded from nzbget admin panel while it's running?

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

Re: nzbget asks for username/password when run from upstart

Post by hugbug » 05 May 2015, 12:56

No.
Just pass the correct one and it will not load any other.

void.pointer
Posts: 60
Joined: 28 Sep 2014, 20:58

Re: nzbget asks for username/password when run from upstart

Post by void.pointer » 05 May 2015, 14:24

I'm asking because I found 5 config files in different locations on my system and I'm not sure which one was originally being used. There is one at /home/robert/.nzbget, I assume this one will be used if I run nzbget under my user 'robert'?

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

Re: nzbget asks for username/password when run from upstart

Post by hugbug » 05 May 2015, 17:07

Command "nzbget -p" prints which file is used. However it doesn't start nzbget server. But you can put it into your service file and add output redirection.

void.pointer
Posts: 60
Joined: 28 Sep 2014, 20:58

Re: nzbget asks for username/password when run from upstart

Post by void.pointer » 05 May 2015, 23:02

Thanks, running "nzbget -p" shows it is using the .nzbget file from my profile (expected). I have these other conf files. Can I delete all of these?

Code: Select all

/etc/init/nzbget.conf
/usr/local/share/nzbget/nzbget.conf
/usr/local/etc/nzbget.conf

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

Re: nzbget asks for username/password when run from upstart

Post by hugbug » 05 May 2015, 23:15

Search order:
"~/.nzbget",
"/etc/nzbget.conf",
"/usr/etc/nzbget.conf",
"/usr/local/etc/nzbget.conf",
"/opt/etc/nzbget.conf",

Your profile's config isn't used when starting as sevice on boot, because you are not logged in yet and the home directory is different.

The file in share must remain, it contains option descriptions used in webui.
You can delete the file in /etc/init, it's not used.
The last one seems to be the actual config used by upstart script.

void.pointer
Posts: 60
Joined: 28 Sep 2014, 20:58

Re: nzbget asks for username/password when run from upstart

Post by void.pointer » 05 May 2015, 23:22

Thanks for your all your help hugbug, you've been fantastic. Love NZBget, keep up the great work.

Post Reply

Who is online

Users browsing this forum: No registered users and 60 guests