Page 1 of 1

Ubuntu: Starting sabnzbdplus as service, but no dice...

Posted: August 31st, 2009, 11:13 pm
by hohead
Hey folks,

I setup XBMC on my fresh Ubuntu install, and I'm hoping to have sabnzbdplus run as a service in the background.
My session (upon startup) goes directly into XBMC (gnome is not started).

Upon startup, it appears as though sabnzbplus has started, but when I try and go to the web interface, I get "Firefox can't establish a connection to the server at 192.168.1.154:8080".

When I check the system monitor, I can see that the service is running:
Image

If I stop the service, and restart it:
xbmc@rocky:~$ sudo /etc/init.d/sabnzbdplus stop
* Stopping SABnzbd+ binary newsgrabber                                          [ OK ]
xbmc@rocky:~$ sudo /etc/init.d/sabnzbdplus start
* Starting SABnzbd+ binary newsgrabber                                          [ OK ]
All of a sudden I can log into the web interface. Very frustrating.

This is my /etc/default/sabnzbdplus:
# This file is sourced by /etc/init.d/sabnzbdplus
#
# When SABnzbd+ is started using the init script, the
# --daemon option is always used, and the program is
# started under the account of $USER, as set below.
#
# Each setting is marked either "required" or "optional";
# leaving any required setting unconfigured will cause
# the service to not start.

# [required] user or uid of account to run the program as:
USER=xbmc

# [optional] full path to the configuration file of your choice;
#            otherwise, the default location (in $USER's home
#            directory) is used:
CONFIG=

# [optional] hostname/ip and port number to listen on:
HOST=
PORT=

# [optional] extra command line options, if any:
EXTRAOPTS=

I checked my /home/xbmc/.sabnzbd/logs/sabnzbd.error.log, and I found this:
Exception in thread CPHTTPServer Thread-7:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/threading.py", line 446, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/var/lib/python-support/python2.5/cherrypy/_cpserver.py", line 114, in _start_http
    self.httpserver.start()
  File "/var/lib/python-support/python2.5/cherrypy/_cpwsgiserver.py", line 370, in start
    raise socket.error, msg
error: (99, 'Cannot assign requested address')
Any ideas?

Thank you for your time!

Re: Ubuntu: Starting sabnzbdplus as service, but no dice...

Posted: September 1st, 2009, 2:05 am
by switch
Launch sabnzbd with the host of 0.0.0.0

SABnzbd is starting up before your local ip address is ready for things to listen on it.

Re: Ubuntu: Starting sabnzbdplus as service, but no dice...

Posted: September 1st, 2009, 7:31 pm
by hohead
Awesome, thanks for your reply. I will try that tonight!

I want to make sure that I can access the web interface from another PC on the LAN. My understanding if that 0.0.0.0 will only allow localhost connections?

Is there a way to delay the sabnzbd service from starting until after my network connection is setup with an IP?

Thanks for your help!

Edit: I made this change, and it works like a charm! For some reason, 0.0.0.0 still allows me to connect from another PC on the LAN as well.

Thanks again!

Re: Ubuntu: Starting sabnzbdplus as service, but no dice...

Posted: September 2nd, 2009, 1:45 am
by shypike
hohead wrote: For some reason, 0.0.0.0 still allows me to connect from another PC on the LAN as well.
0.0.0.0 means: use all available addresses.
In practice this usually means the system's IP address and "localhost".

Re: Ubuntu: Starting sabnzbdplus as service, but no dice...

Posted: September 2nd, 2009, 4:18 am
by jcfp
hohead wrote: Is there a way to delay the sabnzbd service from starting until after my network connection is setup with an IP?
With a dynamically configured address (dhcp, ppp, etc) there isn't really a way to guarantee a certain ip will be present by the time the service starts. Starting the service as late as possible does give a lower chance of running into this kind of problem though, and is already scheduled to be in new releases of the package. See this bug report. On existing installs, the following command would achieve the same result:

Code: Select all

sudo update-rc.d -f sabnzbdplus remove && sudo update-rc.d sabnzbdplus defaults 98 02
Still, the "real" solutions are either listening on any ipv4 interface (by setting 0.0.0.0 as you have), or configuring a fixed ip in the OS.

Re: Ubuntu: Starting sabnzbdplus as service, but no dice...

Posted: October 21st, 2009, 10:23 am
by jason32835
I had to register for an account just so I could say THANK YOU!!! for posting this fix.