Error while setting SABnzbd to run as daemon at startup [solved, for now]

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
3bm4
Newbie
Newbie
Posts: 3
Joined: August 2nd, 2008, 6:48 am

Error while setting SABnzbd to run as daemon at startup [solved, for now]

Post by 3bm4 »

Following instructions here: http://sabnzbd.wikidot.com/install-as-a-unix-daemon and here: http://www.xs4all.nl/~mgj1/sabnzbd.htm
I tried to get sabnzbd to start automatically as a daemon.

THe init.d update does not seem to work (sab is nto running after startup) but I've found at least one error that might indicate why.
When I try to run the script manually using

Code: Select all

sudo /etc/init.d/sabnzbd start
I am greeted with:

Code: Select all

Starting SABnzbd.
Error:
I refuse to fork without a log directory!
and sab does not start. It refuses to fork.

However, if i run sabnzbd.py directly, it start and runs fine (as long as i keep the terminal open, of course).

I did run and configure sab before setting up the script, and all its happy directories exist, including ~/.sabnzbd/logs

So what have I done wrong? Why is there a problem finding/writing to the log dir when trying to start sab from the script.

Any help would be greatly appreciated.

edit: OS is Ubuntu 8.04
Last edited by 3bm4 on August 2nd, 2008, 8:06 pm, edited 1 time in total.
3bm4
Newbie
Newbie
Posts: 3
Joined: August 2nd, 2008, 6:48 am

Re: Error while setting SABnzbd to run as daemon at startup

Post by 3bm4 »

Ok, so playing with it a bit more, I find that the init.d script works just fine if I change the sudo user to root, which leads me to believe this is a folder permissions/ownership problem.
I read in other threads that running the python file as root is strongly discouraged, so  I'm wondering what I should do to be able to run it as myusername.

Clearly myusername already owns ~/.sabnzbd but do I also need to own the sabnzbd source directories in /usr/src?
3bm4
Newbie
Newbie
Posts: 3
Joined: August 2nd, 2008, 6:48 am

Re: Error while setting SABnzbd to run as daemon at startup

Post by 3bm4 »

Alright, problem solved.

Apparently I started sab the first (few) times as root, and even though the working directory was /home/myusername/, some of the directories in ~/.sabnzbd were created as root, who held ownership. So trying to run as myusername I was not allowed to write to those directories.

a simple

Code: Select all

chown -hR myusername /home/myusername/.sabnzbd
fixed things.

silly me for assuming myusername owned everything inside /home/myusername/ (I'm new to this, and it made sense at the time.)


Anyway, loving the latest sab+ version. I've been using 0.2.5 for the past couple of years, but not with a server running, it was time to upgrade. Thanks for the hard work guys.
Post Reply