Gentoo initscript problems ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

When I start my vdr on the console with :

vdr -L PLUGINS/lib/ -c /etc/vdr -v /video0 -w 60 -s /usr/local/bin/HALT -P'xine -r' -Ploadepg
I have no problem :-)

But with the followings scripts, my VDR keeps crashing...

I use this /etc/init.d/dvb :

---
#!/sbin/runscript

start() {
  ebegin "dvb up"
    modprobe dvb-core
    modprobe ves1x93
    modprobe stv0299
    modprobe saa7146
    modprobe saa7146_vv
    modprobe ttpci-eeprom
    modprobe dvb-ttpci
    modprobe budget-core
    modprobe budget
    modprobe budget-ci
  eend $? "dvb up failed"
}

stop() {
  ebegin "dvb down"
    rmmod budget-ci
    rmmod budget
    rmmod budget_core
    rmmod dvb_ttpci
    rmmod stv0299
    rmmod ves1820
    rmmod tda8083
    rmmod sp8870
    rmmod ves1x93
    rmmod dvb_core
    rmmod saa7146_vv
    rmmod video_buf
    rmmod saa7146
    rmmod ttpci_eeprom
    rmmod l64781
    rmmod tda1004x
  eend $? "dvb down failed"
}
---
And this /etc/init.d/vdr :
---
#!/sbin/runscript

opts="${opts} fullrestart"

LOGFILE="/dev/null"

depend() {
	    need localmount dvb
}

start() {
	    ebegin "Starting vdr"
	    sleep 1
            su $VDRUSR -c "nice -n -1 $VDRPRG $LOGLEVEL $VDRTTY $LIBDIR \
	    $CONFDIR $RECDIR $SHUTDOWN $PLUGINS" >> $LOGFILE 2>&1 &
	    eend $? "Couldn't start vdr"
}

stop() {
	    ebegin "Stopping vdr"
		 $KILL $VDRPRG >> $LOGFILE 2>&1 &
		 sleep 4
		 killall -9 vdr >> $LOGFILE 2>&1 &
	    eend $? "Couldn't stop vdr"
}

fullrestart() {
            ebegin "Restarting vdr"
	         /etc/init.d/vdr stop
		 killall xawtv
		 killall -KILL xawtv
		 sleep 5
		 /etc/init.d/dvb stop
		 /etc/init.d/dvb start
		 /etc/init.d/vdr start
	    eend $? "Couldn't restart vdr"
}
---
This /etc/init.d/vdrwatchdog :
---
#!/sbin/runscript

depend() {
	after vdr
}

start() {
	ebegin "Starting vdrwatchdog"
	start-stop-daemon 	--start \
            			--background \
	        		--make-pidfile \
				--pidfile /var/run/vdrwatchdog.pid \
				--exec $WATCHDOG 
	eend $? "Failed to start vdrwatchdog."
}

stop() {
	ebegin "Stopping vdrwatchdog"
	start-stop-daemon --stop --pidfile /var/run/vdrwatchdog.pid
	eend $? "Failed to stop vdrwatchdog."
}
---
With /usr/local/bin/vdrwatchdog.sh :
---
#!/bin/bash
#
# Copyright 2003 Martin Hierling <mad@xxxxxxxxxxxxxx>
# Distributed under the GPL
#
# watchdog script to restart vdr after failure
# to stop watchdog temporarily touch /tmp/nowatchdog
#
#
while sleep 8; do

	[ -f /tmp/nowatchdog ] && continue

	pidof /usr/local/bin/vdr > /dev/null && RUN=1

	if [ -z $RUN ]; then
		 logger -i -t vdrwatchdog -p local0.info "initializing full VDR restart"
		/etc/init.d/vdr fullrestart 2>&1 >/dev/null
	fi
	unset RUN
done
---
With /etc/conf.d/vdrwatchdog :
---
# Path to the VDR watchdog shellscript:
WATCHDOG="/usr/local/bin/vdrwatchdog.sh"
---
And /etc/conf.d/vdr :
---
# Location of the VDR binary:
VDRPRG="/usr/local/bin/vdr"

# Set log level (default: 3)
# 0 = no logging, 1 = errors only
# 2 = errors and info, 3 = errors, info and debug
# if logging should be done to LOG_LOCALn instead of
# LOG_USER, add '.n' to LEVEL, as in 3.7 (n=0..7)
#LOGLEVEL="-l 0" 

# Define the terminal VDR runs on:
VDRTTY="-t /dev/tty8"

# Location of the plugin libraries:
LIBDIR="-L /usr/local/bin/PLUGINS/lib"

# Location of the VDR configuration files:
CONFDIR="-c /etc/vdr"

#Destination for VDR recordings:
#RECDIR="-v /video0"

#Location of the shutdown shellscript:
SHUTDOWN="-w 60 -s /usr/local/bin/HALT"

# User that will run VDR:
VDRUSR="root"

#How to end VDR in the case of a restart:
KILL="/bin/killall -q -TERM"

#The next line is to call the plugins and their options:
PLUGINS="-P'xine -r' -Ploadepg"
---

Any idea on what's wrong with this setup ?
-- 
	Gr?goire Favre
___________________________________________________________________
http://magma.epfl.ch/Gregoire.Favre mailto:Gregoire.Favre@xxxxxxxxx


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux