NZBGet start as service is not working

Hi all,

I managed to install NZBGet with the following commands.

sudo wget https://nzbget.net/download/nzbget-latest-bin-linux.run
sudo sh nzbget-latest-bin-linux.run

Successfully installed into /opt/nzbget
Web-interface is on http://192.168.253.23:6789 (login:nzbget, password:*******)

If I start it manually within console it is working and the webinterface can be reached.

./nzbget -s

But if I try to start as service it does not work. I already tried different scripts I found in different forums but none worked.

/etc/systemd/system/nzbget.service

[Unit]
Description=NZBGet Daemon
Documentation=Documentation
After=network.target

[Service]
User=osmc
Group=osmc
Type=forking
ExecStart=/opt/nzbget/nzbget -D
ExecStop=/opt/nzbget/nzbget -Q
ExecReload=/opt/nzbget/nzbget -O
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

Status gives me the following:

osmc@osmc:/opt/nzbget$ sudo service nzbget start
Job for nzbget.service failed. See ‘systemctl status nzbget.service’ and ‘journalctl -xn’ for details.

osmc@osmc:/opt/nzbget$ sudo systemctl status nzbget.service -l

  • nzbget.service - NZBGet Daemon
    Loaded: loaded (/etc/systemd/system/nzbget.service; enabled)
    Active: failed (Result: start-limit) since Sat 2017-11-25 18:47:22 CET; 53s ago
    Docs: Documentation
    Process: 1785 ExecStop=/opt/nzbget/nzbget -Q (code=exited, status=1/FAILURE)
    Process: 1782 ExecStart=/opt/nzbget/nzbget -D (code=exited, status=0/SUCCESS)

Nov 25 18:47:22 osmc systemd[1]: Failed to start NZBGet Daemon.
Nov 25 18:47:22 osmc systemd[1]: Unit nzbget.service entered failed state.
Nov 25 18:47:22 osmc systemd[1]: nzbget.service holdoff time over, scheduling restart.
Nov 25 18:47:22 osmc systemd[1]: Stopping NZBGet Daemon…
Nov 25 18:47:22 osmc systemd[1]: Starting NZBGet Daemon…
Nov 25 18:47:22 osmc systemd[1]: nzbget.service start request repeated too quickly, refusing to start.
Nov 25 18:47:22 osmc systemd[1]: Failed to start NZBGet Daemon.
Nov 25 18:47:22 osmc systemd[1]: Unit nzbget.service entered failed state.

Any idea what else I can try?

Thanks
Tombar

My guess is that nzbget wants to write something to /opt/nzbget but it’s running as user osmc and doesn’t have write permission.

unfortunately not…owner of directory is osmc and I set permissions to 755.

I’m still leaning towards some kind of permission issue, though without further details of your set-up it’s going to be hard to give anything but stabs in the dark.

For now, comment out the user and group in nzbget.service and see if that helps. (Don’t forget to run sudo systemctl daemon-reload after you make the change.)

just tried it again…now it is working. Maybe something was still wrong with permissions. I also rebooted. Looks good now.

Good to hear it’s sorted.