LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-28-2011, 03:25 PM   #1
kiniki
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Rep: Reputation: Disabled
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
 
Old 09-28-2011, 03:31 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 09-28-2011, 03:42 PM   #3
kiniki
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
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?
 
Old 09-28-2011, 03:48 PM   #4
kiniki
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
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
 
Old 09-28-2011, 04:01 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,669

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
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.
 
Old 09-28-2011, 04:20 PM   #6
kiniki
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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
 
Old 09-28-2011, 05:10 PM   #7
snooly
Member
 
Registered: Sep 2011
Posts: 124

Rep: Reputation: Disabled
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.

Last edited by snooly; 09-28-2011 at 05:12 PM.
 
Old 09-28-2011, 05:12 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,669

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
If a firewall is running does it allow traffic on port 8081?

Last edited by michaelk; 09-28-2011 at 05:14 PM.
 
Old 09-28-2011, 05:29 PM   #9
kiniki
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
"Host does not exist"

Firewall port forwarded :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Organize Your Shows with Sickbeard LXer Syndicated Linux News 0 09-14-2011 11:20 AM
How to set and run hdparm -m at on boot up. solorize Linux - Hardware 2 04-19-2011 03:25 PM
I run Fedora 9 and I boot from USB, how I run at startup Firewall and antivirus? gginis Linux - Software 3 06-08-2008 03:19 AM
set your default run level so you will boot to a default run level - vga console Adam555 Linux - Newbie 1 01-21-2008 04:55 PM
Set Syslogd to run with -r switch at boot? sirpimpsalot Linux - Newbie 3 09-24-2004 12:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration