Skip to content

Windows service and Linux start scripts

theotherp edited this page Aug 10, 2024 · 6 revisions

Windows

In the main Hydra directory there's a WindowsService subfolder which contains batch scripts to install and uninstall Hydra as a service. Run them as administrator.

Linux

In the main Hydra directory there are two folders systemd and upstart. Check them out. Take the scripts as a pointer. I'm not a linux expert.

Ubuntu/LinixMint 20 - systemd install

Assumptions

  • You know basic Linux commands in the terminal
  • You know how to unzip a file (unzip nzbhydra2-3.9.0-linux.zip -d ~/Downloads/nzbhydra2-3.9.0-linux)
  • You know how to edit a file
  • You have unzipped the nzbhydra2-3.9.0-linux.zip into your home's Downloads directory (~/Downloads/nzbhydra2-3.9.0-linux)
  • You have python 3 installed

This is more of a rough guideline.

High Level Steps

  • Create a system account called nzbhydra2
  • Copy over executables and conf files
  • Edit nzbhydra2 service
  • Install Service

Create nzbhydra2 system account:

sudo adduser --system --no-create-home --group nzbhydra2

Copy nzbhydra2 to /opt:

cd ~
wget https://github.com/theotherp/nzbhydra2/releases/download/v7.3.0/nzbhydra2-7.3.0-amd64-linux.zip (or latest version)
unzip nzbhydra2-7.3.0-amd64-linux.zip -d nzbhydra2
sudo mkdir -p /opt/nzbhydra2
sudo cp -r nzbhydra2/* /opt/nzbhydra2

Set permissions:

sudo chown -R nzbhydra2:nzbhydra2 /opt/nzbhydra2/

Edit nzbhydra2.service in systemd:

vi systemd/nzbhydra2.service

Change the following to look like this:
User=nzbhydra2
Group=nzbhydra2
WorkingDirectory=/opt/nzbhydra2/ ExecStart=python3 /opt/nzbhydra2/nzbhydra2wrapperPy3.py --nobrowser

Install nzbhydra2 service:

sudo cp systemd/nzbhydra2.service /lib/systemd/system/

Enable the service on system startup:

sudo systemctl enable nzbhydra2

Start the service:

sudo systemctl start nzbhydra2

Check to see if the status is running:

sudo systemctl status nzbhydra2

To stop the service:

sudo systemctl stop nzbhydra2

To disable the auto startup:

sudo systemctl disable nzbhydra2