Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jpcaparas/0c8e8b8722d7363042be97a073cbd19f to your computer and use it in GitHub Desktop.
Save jpcaparas/0c8e8b8722d7363042be97a073cbd19f to your computer and use it in GitHub Desktop.
Sonarr & NZBGet Systemd service files

Instructions

The files are made for systems with systemd. The instructions are written with Ubuntu 16.04 in mind. Your file locations may vary.

Installation

  1. Become root
  2. Create the service files in lib/systemd/system
  3. Change <user> in the Sonarr service file to the approriate user.

Notes

  1. Installation of Sonarr in /opt/NzbDrone/
  2. Installation of NZBGet in /opt/nzbget
  3. The NZBGet service is tied to the Sonarr service. This means that when you start the Sonarr service, the NZBGet service is started automatically and when you stop the NZBGet service the Sonarr service is stopped.
[Unit]
Description=NZBGet Daemon
After=network.target
[Service]
Type=forking
User=%i
ExecStart=/opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf -D
ExecStop=/opt/nzbget/nzbget -Q
ExecReload=/opt/nzbget/nzbget -O
KillMode=process
[Install]
WantedBy=multi-user.target
[Unit]
Description=Sonarr Daemon
After=syslog.target network.target
BindsTo=nzbgetd.service
[Service]
User=<user>
Group=<user>
Type=simple
ExecStart=/usr/bin/mono /opt/NzbDrone/NzbDrone.exe -nobrowser
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment