SabNZB Linux

Fra Millenium's Wiki
Spring til navigation Spring til søgning

Installer

sudo apt install software-properties-common
sudo add-apt-repository contrib
sudo apt update
sudo apt install sabnzbdplus python-sabyenc par2

Opret service

Fisket fra Linuxbabe - How to Install SABnzbd Usenet Client on Debian Server/Desktop

Although the sabnzbdplus package provides a traditional Init script (/etc/init.d/sabnzbdplus), I found it wouldn’t work. I ran the following command to start the service.

sudo service sabnzbdplus start

If I list the listening ports on my Debian system with the following command, port 8080 is nowhere to be found, (SABnzbd by default listens on port 8080.) which indicates it’s not running.

sudo ss -lnpt | grep 8080

The better way to start SABnzbd is to use Systemd service unit. We can use a command-line text editor such as Nano to create a Systemd service for SABnzbd.

sudo nano /etc/systemd/system/sabnzbd.service

Put the following text into the file.

[Unit]
Description=SABnzbd Usenet Client
After=network.target

[Service]
Type=simple
User=sabnzbd
Group=sabnzbd
ExecStart=/usr/bin/python -OO /usr/bin/sabnzbdplus --browser 0 
ExecStop=/usr/bin/pkill sabnzbdplus
Restart=always
SyslogIdentifier=SABnzbd Usenet Client

[Install]
WantedBy=multi-user.target

SABnzbd listens on port 8080 by default. If this port is being used by another process on your system, then SABnzbd will automatically choose a different port. I recommend choosing a port directly in the ExecStart parameter like below, which will make SABnzbd listen on port 8081.

ExecStart=/usr/bin/python -OO /usr/bin/sabnzbdplus -s 127.0.0.1:8081 --browser 0

Save and close the file. (To save a file in Nano text editor, press Ctrl+O, then press Enter to confirm. To close the file, press Ctrl+X.)

Then reload Systemd.

sudo systemctl daemon-reload

Note that SABnzbd doesn’t require root privilege to run. so we’ve specified in the .service file that SABnzbd should run as the sabnzbd user and group, which have no root privileges. Create the sabnzbd system user and group with the following command. The home directory will be used to save configuration file (/home/sabnzbd/.sabnzbd/sabnzbd.ini).

sudo adduser --system --home /home/sabnzbd --group sabnzbd

Now we can use the systemd service to start sabnzbd.

sudo systemctl start sabnzbd

Enable auto-start at boot time.

sudo systemctl enable sabnzbd

Now check sabnzbd status.

systemctl status sabnzbd

Sample output:

Sabnzbd sample output.png