LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Set Sickbeard to run at boot? (https://www.linuxquestions.org/questions/linux-newbie-8/set-sickbeard-to-run-at-boot-905478/)

kiniki 09-28-2011 03:25 PM

Set Sickbeard to run at boot?
 
I'm having a problem with the program Sickbeard as it quits whenever I exit Putty. I want it to autorun at boot.

Someone said to run it as a Daemon? But they didn't offer anything more than that!

The command to launch it from the Terminal is
Code:

# python2 SickBeard.py
When I type that it works fine... but if I quit the terminal... it quits.

Can anyone tell me what I need to edit.. or what command I need to type in order for it to just run when the machine is turned on?

I'm really very new to Linux!

Thanks

TobiSGD 09-28-2011 03:31 PM

You didn't mention which distribution you are using. The easiest way is to add this command to the file rc.local:
Code:

python2 SickBeard.py &
In Slackware the file is located in /etc/rc.d/ but this may differ from distro to distro, just search for that file in the /etc directory or one of its sub-directories.

kiniki 09-28-2011 03:42 PM

Quote:

Originally Posted by TobiSGD (Post 4484743)
You didn't mention which distribution you are using. The easiest way is to add this command to the file rc.local:
Code:

python2 SickBeard.py &
In Slackware the file is located in /etc/rc.d/ but this may differ from distro to distro, just search for that file in the /etc directory or one of its sub-directories.

I think it's ARCH?

kiniki 09-28-2011 03:48 PM

There is a file in /etc/rc'd/ with the below info in....


Code:

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Starting Sick Beard"
   
    if [ -f /var/run/daemons/sickbeard ]; then
            echo -n "Sick Beard is already running as a daemon!"
            stat_fail
    else
            su - sickbeard -c "python2 /opt/sickbeard/SickBeard.py  &> /dev/null &" -s /bin/sh
            if [ $? -gt 0 ]; then
                    stat_fail
            else
                    add_daemon sickbeard
                    stat_done
            fi
    fi
    ;;
  stop)
    stat_busy "Stopping Sick Beard"
   
    curl -f http://localhost:8081/home/shutdown/ &> /dev/null

    if [ $? -gt 0 ]; then
                  stat_fail
    else
            rm_daemon sickbeard
                  stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0


michaelk 09-28-2011 04:01 PM

If you are running Arch then to configure a daemon to start at boot:
https://wiki.archlinux.org/index.php/Daemon

If not not running Arch then a google search should be able to find a howto for your distribution.

kiniki 09-28-2011 04:20 PM

Quote:

Originally Posted by michaelk (Post 4484771)
If you are running Arch then to configure a daemon to start at boot:
https://wiki.archlinux.org/index.php/Daemon

If not not running Arch then a google search should be able to find a howto for your distribution.

Followed that guide... added to the list... But it's not working properly

Tried
Code:

/etc/rc.d/sickbeard start
and it's says Already running...

But when I navigate to the web based config on 192.168.7.2:8081 it can't load the page

snooly 09-28-2011 05:10 PM

Try going into the sickbeard box with ssh. Then use telnet to see if the sicko server is running, something like this:

telnet 127.0.0.1 8081

If the connection is refused, there is no server running, like this:

telnet 127.0.0.1 8081
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

If there is something listening on port 8081, the output will be different.

Then you can try doing the telnet from another machine, using the IP address you posted above:

telnet 192.168.7.2 8081

Note that you don't want the colon for a telnet session, telnet can take two arguments, the IP address and the port number.

You can kill the telnets if there is a server running and you can't figure out how to make telnet stop.

michaelk 09-28-2011 05:12 PM

If a firewall is running does it allow traffic on port 8081?

kiniki 09-28-2011 05:29 PM

"Host does not exist"

Firewall port forwarded :-)


All times are GMT -5. The time now is 09:03 AM.