how run SABnzbd git version as a daemon / service?

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
sander
Release Testers
Release Testers
Posts: 6628
Joined: January 22nd, 2008, 2:22 pm

how run SABnzbd git version as a daemon / service?

Post by sander » March 8th, 2019, 3:52 am

EDIT

A PEBKAC after all ... ? The git version is running now as wanted.
It seems the ~/.sabnzbd/logs/sabnzbd.log I was looking at is not updated at all, so I was looking at old info?
After setting HOST=0.0.0.0 in /etc/default/sabnzbdplus, everything is Ok


/EDIT

I want to auto-start the git version via the "service sabnzbdplus" commands.

First of all: the basics are working: The git version is working from CLI, the PPA version can be run nicely from the usual commands. Just combine it ... should not be difficult ... ;)

So I did this: I edited /etc/init.d/sabnzbdplus to contain this:

Code: Select all

NAME="sabnzbdplus"
#DAEMON="/usr/bin/sabnzbdplus"
DAEMON="/home/sander/git/sabnzbd/SABnzbd.py"
SETTINGS="/etc/default/$NAME"
Then I ran "sudo systemctl daemon-reload"

A "sudo service sabnzbdplus restart" does start the git version, but it ends quickly in a Signal 2:

Code: Select all

2019-03-08 09:39:16,934::INFO::[urlgrabber:82] URLGrabber starting up
2019-03-08 09:39:16,938::INFO::[postproc:187] Completed Download Folder /home/sander/Downloads/complete is not on FAT
2019-03-08 09:39:16,968::INFO::[zconfig:76] Bonjour/ZeroConfig does not support "localhost"
2019-03-08 09:39:22,425::WARNING::[__init__:182] Signal 2 caught, saving and exiting...
2019-03-08 09:39:22,425::INFO::[nzbqueue:260] Saving queue
2019-03-08 09:39:22,426::INFO::[postproc:94] Saving postproc queue
... and sab is still kind of running? See:

Code: Select all

$ sudo ps -ef | grep -i sabnzbd
sander    2827     1  0 09:49 ?        00:00:00 /usr/bin/python -OO /home/sander/git/sabnzbd/SABnzbd.py --daemon --pidfile /var/run/sabnzbdplus/pid
sander    2863  2053  0 09:50 pts/0    00:00:00 grep --color=auto -i sabnzbd
@jcfp ... tips how to handle this?

EDIT

Code: Select all

[email protected]:~$ sudo service sabnzbdplus status
● sabnzbdplus.service - LSB: SABnzbd+ binary newsgrabber
   Loaded: loaded (/etc/init.d/sabnzbdplus; generated)
   Active: active (running) since Fri 2019-03-08 11:47:25 CET; 22s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1450 ExecStart=/etc/init.d/sabnzbdplus start (code=exited, status=0/SUCCESS)
    Tasks: 25 (limit: 2341)
   CGroup: /system.slice/sabnzbdplus.service
           └─1868 /usr/bin/python -OO /home/sander/git/sabnzbd/SABnzbd.py --daemon --pidfile /var/run/sabnzbdplus/pid

Mär 08 11:47:16 haring1 systemd[1]: Starting LSB: SABnzbd+ binary newsgrabber...
Mär 08 11:47:17 haring1 sabnzbdplus[1450]:  * Starting SABnzbd+ binary newsgrabber
Mär 08 11:47:25 haring1 sabnzbdplus[1450]:    ...done.
Mär 08 11:47:25 haring1 systemd[1]: Started LSB: SABnzbd+ binary newsgrabber.

User avatar
OneCD
Sr. Member
Sr. Member
Posts: 282
Joined: March 4th, 2017, 3:47 pm

Re: how run git version as a daemon / service?

Post by OneCD » March 8th, 2019, 4:07 am

sander wrote:
March 8th, 2019, 3:52 am
A "sudo service sabnzbdplus restart" does start the git version, but it ends quickly in a Signal 2:
On my Debian 9.8, this is:

Code: Select all

sudo systemctl restart [email protected]<my user name>.service
Stuff I like: Apache BASH CRON DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo S20 Python Raspberry Pi RAID SABnzbd+ SickChill Transmission Usenet VirtualBox Watcher3 WordPress XFCE

User avatar
sander
Release Testers
Release Testers
Posts: 6628
Joined: January 22nd, 2008, 2:22 pm

Re: how run git version as a daemon / service?

Post by sander » March 8th, 2019, 4:51 am

On my Ubuntu, that gives

Code: Select all

$ sudo systemctl restart [email protected]
Failed to restart [email protected]: Unit [email protected] not found.
So no solution.

User avatar
jcfp
Release Testers
Release Testers
Posts: 888
Joined: February 7th, 2008, 12:45 pm

Re: how run git version as a daemon / service?

Post by jcfp » March 8th, 2019, 7:21 am

sander wrote:
March 8th, 2019, 3:52 am
A PEBKAC after all ... ? The git version is running now as wanted.
It seems the ~/.sabnzbd/logs/sabnzbd.log I was looking at is not updated at all, so I was looking at old info?
Could well be, the packaged version is patched to change some homedir handling , see https://sources.debian.org/src/sabnzbdp ... emon.diff/
OneCD wrote:
March 8th, 2019, 4:07 am
On my Debian 9.8, this is:

Code: Select all

sudo systemctl restart [email protected]<my user name>.service
This only works if you put in a native systemd service yourself, the package doesn't ship one.

User avatar
sander
Release Testers
Release Testers
Posts: 6628
Joined: January 22nd, 2008, 2:22 pm

Re: how run SABnzbd git version as a daemon / service?

Post by sander » March 8th, 2019, 9:46 am

I found the 'real' sabnzbd.log: within the git directory.

Code: Select all

[email protected]:~/git/sab-py3$ find . -name sabnzbd.log -print
./logs/sabnzbd.log

$ ll /home/sander/git/sab-py3/logs/sabnzbd.log 
-rw-r--r-- 1 sander sander 2014399 Mär  8 15:54 /home/sander/git/sab-py3/logs/sabnzbd.log



User avatar
OneCD
Sr. Member
Sr. Member
Posts: 282
Joined: March 4th, 2017, 3:47 pm

Re: how run git version as a daemon / service?

Post by OneCD » March 8th, 2019, 2:18 pm

jcfp wrote:
March 8th, 2019, 7:21 am
This only works if you put in a native systemd service yourself, the package doesn't ship one.
Well, we're discussing the git version, not the package, so there's: https://github.com/sabnzbd/sabnzbd/blob ... 40.service
Stuff I like: Apache BASH CRON DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo S20 Python Raspberry Pi RAID SABnzbd+ SickChill Transmission Usenet VirtualBox Watcher3 WordPress XFCE

Post Reply