SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-26-2006, 01:02 PM
n8willis n8willis is offline
New Member
 
Join Date: Sep 2006
Posts: 1
init script

Heyo. Is there anyone knowledgable enough to help me write an init script for SageTV server? I could start in on a user login session (GNOME in my case), I suppose, but it'd be better if it started at boot time I think.

Unfortunately, I've never written a boot script. Is it difficult? Does anyone know?

Thanks,
N
Reply With Quote
  #2  
Old 09-26-2006, 01:37 PM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
wish I was home.. its easy just modify a existing one..

you will need to create some symlinks under /etc/rc0 /etc/rc1 /etc/rc2 /etc/rc3 . for startup and stopping server

or you can take the easy way out

and just modify /etc/rc.local put this line in : /opt/sagetv/server/startsage &
this will startup sagetv application when server is rebooted.

Last edited by oddjob; 09-26-2006 at 02:22 PM.
Reply With Quote
  #3  
Old 12-17-2006, 12:20 AM
npalombo npalombo is offline
New Member
 
Join Date: Dec 2006
Posts: 4
I just set up Sage TV under linux with MVP clients for by brother-in-law. Everything runs well when I start it up. So I want to make sure it starts up at boot time.

As background, I have a lot of experience with linux, and unix in general. For myself at home, I have a MythTV setup. I set up the runlevel scripts for that with no problem. I just want you to know that I am familiar with the linux runlevel start procedure.

That's why this is making me crazy. I have tried everything to get the startsage script to run at startup. Under gentoo, I have installed a start script under /etc/runlevels/default. I tested the script from the command line and verified that it does work at that point. I put in a log and verified the script gets called at startup. But for some reason sage does not start. I can't seem to find any log files to indicate why it doesn't start up. So a couple questions:

Are there any runlevel scripts that I should be sure run before startsage?

Is there a log file or a properties I can set to debug the startsage script?



Quote:
Originally Posted by oddjob
wish I was home.. its easy just modify a existing one..

you will need to create some symlinks under /etc/rc0 /etc/rc1 /etc/rc2 /etc/rc3 . for startup and stopping server

or you can take the easy way out

and just modify /etc/rc.local put this line in : /opt/sagetv/server/startsage &
this will startup sagetv application when server is rebooted.
Reply With Quote
  #4  
Old 12-19-2006, 07:24 AM
ChePazzo ChePazzo is offline
Sage Aficionado
 
Join Date: Oct 2004
Posts: 287
I'm still trying to figure this one out. Initially, I just put a smylink in rc.5 to /opt/sagetv/server/startsage. That never worked and when I called it from cmdline, I got an error about not being in the right directory.

Now, I modified an init script and reference startsage and stopsage under the 'start' and 'stop' cases. This is in rc.5. It does not work.

I will try the previous suggestion of also adding it to the other rc's and see if that helps.
Reply With Quote
  #5  
Old 12-19-2006, 09:39 AM
_Demo_ _Demo_ is offline
Moderator
 
Join Date: Mar 2003
Posts: 863
Send a message via ICQ to _Demo_
I have attached a sample gentoo init script that can be added to default runlevel with rc-update add sagetv default.

_Demo_

/etc/init.d/sagetv
Code:
#!/sbin/runscript

depend() {
	need net localmount
	after bootmisc
}

start() {
	ebegin "Starting SageTV server"
	/opt/sagetv/server/startsage
	eend $?
}

stop() {
	ebegin "Stopping SageTV server"
	/opt/sagetv/server/stopsage
	# This can't really fail unless it was not running so we force success
	eend 0
}
Reply With Quote
  #6  
Old 12-20-2006, 02:34 PM
npalombo npalombo is offline
New Member
 
Join Date: Dec 2006
Posts: 4
I won't get a chance to install this until after the new year. But I just wanted to thank you for your help now.

Nick

Quote:
Originally Posted by _Demo_
I have attached a sample gentoo init script that can be added to default runlevel with rc-update add sagetv default.

_Demo_
Reply With Quote
  #7  
Old 01-13-2007, 10:51 AM
chip33az chip33az is offline
Sage User
 
Join Date: Nov 2006
Posts: 66
I just set up an Ubuntu Edgy server and used the following script (placed in /etc/init.d with 755 permissions). I called it sagetv (originial?) To have it run at boot up I did "update-rc.d sagetv defaults 20"

I'm not a scripting person, but it seemed to work just fine.

#!/bin/sh
set -e

case "$1" in
start)
echo "Starting SageTV server"
/opt/sagetv/server/startsage
;;

stop)
echo "Stopping SageTV server"
/opt/sagetv/server/stopsage
;;

*)
echo "Usage: /etc/init.d/sagetv {start|stop}"
exit 1
;;
esac

exit 0
Reply With Quote
  #8  
Old 01-15-2007, 03:33 PM
ChePazzo ChePazzo is offline
Sage Aficionado
 
Join Date: Oct 2004
Posts: 287
On the Ubuntu help pages, I found something to install called Gnome Boot or something like that. basically, it's a GUI to control what gets started at boot.

I copied the samba init script and basically created cases for 'start' (startsage), 'stop' (stopsage) and 'restart' (stopsage, then startsage), and saved it as '/etc/init.d/sagetv'

This GUI found it and allowed me to make it part of the init bootup sequence.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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 On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.