Page 1 of 1
Daemon startup error
Posted: January 2nd, 2013, 2:13 pm
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
Re: Daemon startup error
Posted: January 2nd, 2013, 2:18 pm
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)
Re: Daemon startup error
Posted: January 2nd, 2013, 2:26 pm
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
Re: Daemon startup error
Posted: January 2nd, 2013, 2:32 pm
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
Re: Daemon startup error
Posted: January 2nd, 2013, 2:35 pm
by zanora
I get the "Sorry, requires Python 2.5, 2.6 or 2.7." error.
Re: Daemon startup error
Posted: January 2nd, 2013, 2:42 pm
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:~$
Re: Daemon startup error
Posted: January 2nd, 2013, 2:49 pm
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
Re: Daemon startup error
Posted: January 2nd, 2013, 3:19 pm
by shypike
Start Python and type in this mini-program:
What is the output?
Re: Daemon startup error
Posted: January 2nd, 2013, 3:20 pm
by sander
Aha ... location of python binary ...
What is the output of:
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?
Re: Daemon startup error
Posted: January 2nd, 2013, 5:00 pm
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 <team@sabnzbd.org>
#
# 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.
Re: Daemon startup error
Posted: January 2nd, 2013, 5:05 pm
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
Re: Daemon startup error
Posted: January 2nd, 2013, 5:14 pm
by zanora
Oh cool. That did the trick and sabnzbd is up and running. Thanks sander.
Re: Daemon startup error
Posted: January 2nd, 2013, 5:20 pm
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
Re: Daemon startup error
Posted: January 2nd, 2013, 5:32 pm
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
Re: Daemon startup error
Posted: January 2nd, 2013, 5:40 pm
by sander
Interesting? Annoying! ;-)
If python 2.4 is not needed anymore, the link could be better to python 2.7.