Debian init script

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
Bam
Newbie
Newbie
Posts: 1
Joined: March 20th, 2010, 3:10 pm

Debian init script

Post by Bam »

I got this all running on my debian box today. Maybe this isn't the place to share this?

Code: Select all

#!/bin/bash

case "$1" in
start)
  echo "Starting SABnzbd."
  /usr/bin/sudo -u sabnzb -H /usr/share/sabnzbd/SABnzbd.py -d -f /home/sabnzb/.sabnzbd/sabnzbd.ini
;;
stop)
  echo "Shutting down SABnzbd."
  /usr/bin/wget -q --delete-after "http://localhost:8080/sabnzbd/api?mode=shutdown&apikey=APIKEYHERE"
;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac

exit 0
save above as sabnzbd

init script goes in /etc/init.d

chmod +x

you need to create user sabnzb

also must untar src file to /usr/share/sabnzbd


good luck
User avatar
jcfp
Release Testers
Release Testers
Posts: 989
Joined: February 7th, 2008, 12:45 pm

Re: Debian init script

Post by jcfp »

For a manual install this would work, although you'd probably still have to link it into the various /etc/rcX.d/... either by hand or using update-rc.d. For anything newer than lenny, the program is available as a package which includes an init script already.
danfozzy
Jr. Member
Jr. Member
Posts: 77
Joined: November 25th, 2011, 5:32 am

Re: Debian init script

Post by danfozzy »

Sorry for bumping an old script, but I'm having a problem with autostarting this script.

It runs the script at startup, but just as it runs up I'm getting a signal 15 error and it shuts down again

I've seen a little script that may help but I don't know how to include it in the above script!

start-stop-daemon --quiet --stop --signal 15 --retry 30 --exec $PYTHONEXEC --name $NAME --user $USER

Will this line help me??
Post Reply