Daemon startup error

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
zanora
Newbie
Newbie
Posts: 7
Joined: January 2nd, 2013, 1:57 pm

Daemon startup error

Post by zanora »

I'm currently trying to reinstall sabnzbd 0.7.7 on my readynas through commandline after a reformat and running into a error. I'm having a issue where if i try to start sabnzbd through daemon I get a "Sorry, requires Python 2.5, 2.6 or 2.7" error. Note that I'm using the boilerplate init.d file from http://forums.sabnzbd.org/viewtopic.php?t=2013&start=0 with the correct information fill out. I do have Python 2.7.3 installed and have checked with "python -V". It is also the only version of python installed. sabnzbd does run if I do open it with "python SABnzbd.py".
Thanks
User avatar
sander
Release Testers
Release Testers
Posts: 9264
Joined: January 22nd, 2008, 2:22 pm

Re: Daemon startup error

Post by sander »

Just checking: Is readynas using Ubuntu or Debian?

Can you post the exact init.d file you're using (you can wipe out a password used)
zanora
Newbie
Newbie
Posts: 7
Joined: January 2nd, 2013, 1:57 pm

Re: Daemon startup error

Post by zanora »

It's a x86 debian etch.

Code: Select all

#! /bin/sh
### BEGIN INIT INFO
# Provides:          sabnzbd
# Short-Description: start/stop sabnzbd  web interface
### END INIT INFO


USER="root"
HOME="/root/"
SAB_IP="192.168.1.103:2708"
SAB_USER="*my user"
SAB_PASS="*my password"
SAB_APIKEY="4a245ce678d2b80eebd5c03577c1554f"

case "$1" in
start)
  echo "Starting SABnzbd."
  /usr/bin/sudo -u $USER -H /c/.SABnzbd/SABnzbd.py -d -f $HOME/.sabnzbd/sabnzbd.ini
;;
stop)
  echo "Shutting down SABnzbd."
  /usr/bin/wget -q --delete-after "http://$SAB_IP/sabnzbd/api?mode=shutdown&ma_username=$SAB_USER&ma_password=$SAB_PASS&apikey=$SAB_APIKEY"
;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac

exit 0
User avatar
sander
Release Testers
Release Testers
Posts: 9264
Joined: January 22nd, 2008, 2:22 pm

Re: Daemon startup error

Post by sander »

OK. What happens when you execute the command below from the command line:

Code: Select all

/usr/bin/sudo -u root -H /c/.SABnzbd/SABnzbd.py -d -f /root/.sabnzbd/sabnzbd.ini
zanora
Newbie
Newbie
Posts: 7
Joined: January 2nd, 2013, 1:57 pm

Re: Daemon startup error

Post by zanora »

I get the "Sorry, requires Python 2.5, 2.6 or 2.7." error.
User avatar
sander
Release Testers
Release Testers
Posts: 9264
Joined: January 22nd, 2008, 2:22 pm

Re: Daemon startup error

Post by sander »

zanora wrote:I get the "Sorry, requires Python 2.5, 2.6 or 2.7." error.
So ... does that ring a bell? If not, run the two commands below and post the output here:

Code: Select all

sander@R540:~$ /usr/bin/sudo -u root python --version
Python 2.7.3
sander@R540:~$ 

sander@R540:~$ /usr/bin/sudo -u root which python
/usr/bin/python
sander@R540:~$ 
zanora
Newbie
Newbie
Posts: 7
Joined: January 2nd, 2013, 1:57 pm

Re: Daemon startup error

Post by zanora »

Yeah. This is what I get.

Code: Select all

nas-F9-1E-CC:/# /usr/bin/sudo -u root python --version
Python 2.7.3
nas-F9-1E-CC:/# /usr/bin/sudo -u root which python    
/usr/local/bin/python
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Daemon startup error

Post by shypike »

Start Python and type in this mini-program:

Code: Select all

import sys
print sys.version_info
What is the output?
User avatar
sander
Release Testers
Release Testers
Posts: 9264
Joined: January 22nd, 2008, 2:22 pm

Re: Daemon startup error

Post by sander »

Aha ... location of python binary ...

What is the output of:

Code: Select all

head /c/.SABnzbd/SABnzbd.py
I think "/usr/bin/python", and that would be the root cause. Solution would be to put 'python' in the calling line, possibly something like:

Code: Select all

/usr/bin/sudo -u root -H python /c/.SABnzbd/SABnzbd.py -d -f /root/.sabnzbd/sabnzbd.ini
Can you try that from the command line first?
zanora
Newbie
Newbie
Posts: 7
Joined: January 2nd, 2013, 1:57 pm

Re: Daemon startup error

Post by zanora »

Code: Select all

nas-F9-1E-CC:/# python
Python 2.7.3 (default, Jan  1 2013, 21:16:51) 
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.version_info
sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
>>> 

Code: Select all

nas-F9-1E-CC:/# head /c/.SABnzbd/SABnzbd.py
#!/usr/bin/python -OO
# Copyright 2008-2012 The SABnzbd-Team <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Not sure if this is useful, but I did get sickbeard, couchpotato and headphones to properly start up on boot. Still having issues with sabnzbd tho. Thought it was worth mentioning since they all run python.
User avatar
sander
Release Testers
Release Testers
Posts: 9264
Joined: January 22nd, 2008, 2:22 pm

Re: Daemon startup error

Post by sander »

OK, and what happens when you run the command I gave you?

/usr/bin/sudo -u root -H python /c/.SABnzbd/SABnzbd.py -d -f /root/.sabnzbd/sabnzbd.ini
zanora
Newbie
Newbie
Posts: 7
Joined: January 2nd, 2013, 1:57 pm

Re: Daemon startup error

Post by zanora »

Oh cool. That did the trick and sabnzbd is up and running. Thanks sander.
User avatar
sander
Release Testers
Release Testers
Posts: 9264
Joined: January 22nd, 2008, 2:22 pm

Re: Daemon startup error

Post by sander »

zanora wrote:Oh cool. That did the trick and sabnzbd is up and running. Thanks sander.
OK, cool.

To fully understand the problem: What is the output of:

Code: Select all

ls -al /usr/bin/python

/usr/bin/python --version
zanora
Newbie
Newbie
Posts: 7
Joined: January 2nd, 2013, 1:57 pm

Re: Daemon startup error

Post by zanora »

Code: Select all

nas-F9-1E-CC:~# ls -al /usr/bin/python
lrwxrwxrwx 1 root root 9 2013-01-01 21:24 /usr/bin/python -> python2.4
nas-F9-1E-CC:~# /usr/bin/python --version
Unknown option: --
usage: /usr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
hmm python 2.4? that's interesting
User avatar
sander
Release Testers
Release Testers
Posts: 9264
Joined: January 22nd, 2008, 2:22 pm

Re: Daemon startup error

Post by sander »

Interesting? Annoying! ;-)

If python 2.4 is not needed anymore, the link could be better to python 2.7.
Post Reply