You are not logged in.

#1 2015-07-20 20:56:55

nixIT
Member
Registered: 2010-01-13
Posts: 528

[SOLVED] start nzbget on bootup

Hello all,

I have nzbget configured and running. I noticed in the wiki that nzbget needs to be started manually since there is no service file.

I found on this page: http://dominicm.com/install-nzbget-on-arch-linux/ and copied the service file that was there.

However, it appears that I still can't get nzbget to launch, not sure what to look for.

I did make this change:

ExecStart=/usr/bin/nzbget -D

to

ExecStart=/usr/bin/nzbget -c /usr/local/share/nzbget/nzbget.conf -D

to see if pointing to my config file would work, so far no dice.

Any ideas?

--nixIT

Last edited by nixIT (2015-07-21 18:31:22)


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#2 2015-07-20 21:10:46

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] start nzbget on bootup

Offline

#3 2015-07-21 01:03:04

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: [SOLVED] start nzbget on bootup

@Raynman, Thanx for the link, even though it didn't help me out b/c I'm not sure what log to look in.

Could it be a permission issue? Since I followed the guide that recommended we create a nzbget user and group, and the systemctl enable is running as a different user?

--nixIT


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#4 2015-07-21 09:04:06

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] start nzbget on bootup

If all you can say is "it appears that I still can't get nzbget to launch" and then "log" is all you get from that thread, I give up.

Last edited by Raynman (2015-07-21 09:09:08)

Offline

#5 2015-07-21 12:07:08

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: [SOLVED] start nzbget on bootup

@Raynman,
Thanx for your explanation, how can you give up when you didn't even try?

We are here to learn, and if one knows where to look but doesn't know what to look for one asks for help, which is what I'm doing.

Sources of information
Full output of any command involved
Log files (have a look in /var/log)
Relevant configuration files
Drivers involved
Versions of packages involved

I gave the sources I used to install, I included the command I use to start. even started interactively and didn't see any error messages. I am not sure WHAT log file to look in for messages.

Output of NZBGET log:

nzbget -c /usr/local/share/nzbget/nzbget.conf -G 10
Request sent
Log (last 1 entries)
-----------------------------------
[INFO] nzbget 15.0 server-mode
-----------------------------------

thanx

--nixIT


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#6 2015-07-21 14:27:12

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: [SOLVED] start nzbget on bootup

Here is some more info:

sudo systemctl start nzbget.service
[nixit@nixed share]$ systemctl status nzbget.service -l
● nzbget.service - NZBGet
   Loaded: loaded (/usr/lib/systemd/system/nzbget.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

Jul 21 10:17:00 nixed systemd[1]: Started NZBGet.
Jul 21 10:17:00 nixed systemd[1]: Starting NZBGet...
Jul 21 10:17:00 nixed nzbget[31703]: Request sent
Jul 21 10:19:20 nixed systemd[1]: Started NZBGet.
Jul 21 10:19:20 nixed systemd[1]: Starting NZBGet...
Jul 21 10:19:20 nixed nzbget[31751]: Request sent
Jul 21 10:19:20 nixed nzbget[31751]: server returned: Stopping server
Jul 21 10:21:30 nixed systemd[1]: Stopped NZBGet.
Jul 21 10:23:33 nixed systemd[1]: Started NZBGet.
Jul 21 10:23:33 nixed systemd[1]: Starting NZBGet...

my nzbget.service file is:

[Unit]
Description=NZBGet
# This will load nzbget only after setting up the network
After=network-online.target

[Service]
User=nzbget
ExecStart=/usr/bin/nzbget -c /usr/local/share/nzbget/nzbget.conf -D
ExecStop=/usr/bin/nzbget -c /usr/local/share/nzbget/nzbget.conf -Q
ExecReload=/usr/bin/nzbget -c /usr/local/share/nzbget/nzbget.conf -O
KillMode=process

[Install]
# Needed to run nzbget at boot
WantedBy=multi-user.target

does anyone see anything incorrect? Has anyone gotten nzbget to run as a systemd service?

thanx in advance

--nixIT

Last edited by nixIT (2015-07-21 15:17:22)


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#7 2015-07-21 16:16:06

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] start nzbget on bootup

I don't know what this nzbget thingy is or what it does. The command you are using for the "ExecStart=" line, is it forking another process and quitting immediately, or does it keep running? If it's forking, I think you need to set "Type=forking" or systemd will think that it didn't manage to start correctly, will then try to restart it.

EDIT: You can read up on this in "man systemd.service". Search for "Type=".

Last edited by Ropid (2015-07-21 16:18:15)

Offline

#8 2015-07-21 16:44:44

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: [SOLVED] start nzbget on bootup

@Ropid

Thanx for the info. I'm not sure how to tell if nzbget (newsgroup downloader similar to sabnzbd) is forking another process, however  I added the Type=forking and that appeared to work.

Thanx!

EDIT: Not sure if that is going to cause any security or compatibility issues.

--nixIT

Last edited by nixIT (2015-07-21 16:46:26)


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#9 2015-07-21 19:36:13

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] start nzbget on bootup

You can tell by starting it manually. If it started correctly and is running but you get back to the command prompt after you've started it, it means it is forking to the background.

I noticed that the "systemd.service" man page mentions that systemd tries to guess the process ID of the forked process. It wants to know that PID so that it can detect if the daemon crashes (or just quits for some reason). The text says that this PID detection can fail, and that you can add an option "PIDFile=" that points to a file with the PID. Programs that are supposed to be daemons and fork usually create a file like that somewhere. You could try to find out the name of the PID file for this nzbget program and add the "PIDFile=" option to your .service file. I guess this would only be needed to make sure that nothing can go wrong, so you only need to do this if you don't trust that automatic PID detection for forking programs.

Offline

#10 2015-07-21 22:45:23

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: [SOLVED] start nzbget on bootup

@Ropid

Thanx for all that info, very helpful. I did read about PID on one forum this afternoon, and I did add the PID line, once I found the nzbget pid file. I also added the Type= line at the same time, and that is when the systemd.service file started working. After a couple reboots, I removed the Type= line, left the PID line and it still worked. So my guess is the file was missing the PID line.

Everything seems to be working, and I don't have to manually start nzbget every time I log in.

Thanx for your help! I appreciate it!

--nixIT


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

Board footer

Powered by FluxBB