Page 1 of 1

how run SABnzbd git version as a daemon / service?

Posted: March 8th, 2019, 3:52 am
by sander
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

sander@haring1:~$ 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.

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

Posted: March 8th, 2019, 4:07 am
by OneCD
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 sabnzbd@<my user name>.service

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

Posted: March 8th, 2019, 4:51 am
by sander
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.

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

Posted: March 8th, 2019, 7:21 am
by jcfp
sander wrote: March 8th, 2019, 3:52 amA 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 amOn my Debian 9.8, this is:

Code: Select all

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

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

Posted: March 8th, 2019, 9:46 am
by sander
I found the 'real' sabnzbd.log: within the git directory.

Code: Select all

sander@haring1:~/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



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

Posted: March 8th, 2019, 2:18 pm
by OneCD
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