|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#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 |
#2
|
||||
|
||||
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. |
#3
|
|||
|
|||
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:
|
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
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 } |
#6
|
|||
|
|||
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:
|
#7
|
|||
|
|||
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 |
#8
|
|||
|
|||
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. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|