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

Get help with all aspects of SABnzbd
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
hohead
Newbie
Newbie
Posts: 2
Joined: August 31st, 2009, 10:59 pm

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

Post 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!
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

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

Post 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.
hohead
Newbie
Newbie
Posts: 2
Joined: August 31st, 2009, 10:59 pm

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

Post 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!
Last edited by hohead on September 1st, 2009, 10:05 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post 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".
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

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

Post 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.
jason32835
Newbie
Newbie
Posts: 2
Joined: October 21st, 2009, 10:21 am

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

Post by jason32835 »

I had to register for an account just so I could say THANK YOU!!! for posting this fix.
Post Reply