r1768 - vdr/vdr/trunk/debian

Thomas Schmidt tschmidt at costa.debian.org
Sat Jan 21 15:36:13 UTC 2006


Author: tschmidt
Date: 2006-01-21 15:36:12 +0000 (Sat, 21 Jan 2006)
New Revision: 1768

Modified:
   vdr/vdr/trunk/debian/changelog
   vdr/vdr/trunk/debian/vdr.init
Log:
vdr: Use the same start and stop functions like ctvdr (with some minor changes)

Modified: vdr/vdr/trunk/debian/changelog
===================================================================
--- vdr/vdr/trunk/debian/changelog	2006-01-21 11:16:05 UTC (rev 1767)
+++ vdr/vdr/trunk/debian/changelog	2006-01-21 15:36:12 UTC (rev 1768)
@@ -11,8 +11,10 @@
       + Added 19_vdr-1.3.39-clre-crash-fix
       + Added 20_vdr-1.3.39-schedule-crash-fix
       + Added 21_vdr-1.3.39-keys-fix
+    - Changed init-script to use allmoast the same start and stop 
+      functions like ctvdr
 
- -- Debian VDR Team <pkg-vdr-dvb-devel at lists.alioth.debian.org>  Fri, 20 Jan 2006 22:31:37 +0100
+ -- Debian VDR Team <pkg-vdr-dvb-devel at lists.alioth.debian.org>  Sat, 21 Jan 2006 16:31:47 +0100
 
 vdr (1.3.38-1) unstable; urgency=low
 

Modified: vdr/vdr/trunk/debian/vdr.init
===================================================================
--- vdr/vdr/trunk/debian/vdr.init	2006-01-21 11:16:05 UTC (rev 1767)
+++ vdr/vdr/trunk/debian/vdr.init	2006-01-21 15:36:12 UTC (rev 1768)
@@ -3,34 +3,40 @@
 # vdr start-stop script
 #
 
-test -x /usr/sbin/runvdr || exit 0
-
 . /usr/lib/vdr/config-loader.sh
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 NAME=vdr
 DESC="Linux Video Disk Recorder"
 
+DAEMON=/usr/sbin/runvdr
+PIDFILE=/var/run/runvdr.pid
+VDRPRG=/usr/bin/vdr
+
 test "$ENABLE_SHUTDOWN" = "1" && VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown.wrapper" \
         || VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown-message"
 
+test -x $DAEMON || exit 0
+test -x $VDRPRG || exit 0
+
+. /usr/lib/vdr/plugin-loader.sh
+. /usr/lib/vdr/commands-loader.sh
+
 startvdr() 
 {
     if [ "$ENABLED" != "0" ]; then
         # only start vdr if there is no other instance running
-        # (Appears as vdr-kbd in the official debian-packages
-        # and just as vdr in the c't-vdr packages)
-        if ! ps ax | grep "/usr/bin/\(vdr\|vdr-kbd\) " | grep -qv grep
-        then
-                . /usr/lib/vdr/plugin-loader.sh
-                . /usr/lib/vdr/commands-loader.sh
+	if start-stop-daemon --start --startas $DAEMON --test \
+		--name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
+	then
                 getplugins
                 mergecommands "commands"
                 mergecommands "reccmds"
-                start-stop-daemon --start --quiet --background \
-                        --exec /usr/sbin/runvdr -- -v $VIDEO_DIR -c $CFG_DIR -r $REC_CMD \
-                        -s $VDRSHUTDOWN -E $EPG_FILE -u $USER --port $SVDRP_PORT \
-                        $OPTIONS $PLUGINS
+                start-stop-daemon --start --quiet --startas $DAEMON --background \
+			--name $(basename $DAEMON) --pidfile $PIDFILE --make-pidfile --\
+                        -v $VIDEO_DIR -c $CFG_DIR -L $PLUGIN_DIR -r $REC_CMD \
+                        -s $VDRSHUTDOWN -E $EPG_FILE -u $USER \
+			--port $SVDRP_PORT $OPTIONS $PLUGINS
         else
                 echo -n " - seems to be running already"
         fi
@@ -41,15 +47,13 @@
 
 stopvdr()
 {
-    killall -q -TERM runvdr
-
-    # check if the running process is /usr/bin/vdr or /usr/bin/vdr-kbd
-    if ps ax | grep "/usr/bin/vdr " | grep -qv grep
+    if start-stop-daemon --stop --retry 5 \
+        --name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
     then
-       killall -q -TERM /usr/bin/vdr > /dev/null 2>&1
+    	start-stop-daemon --stop --retry 5 --oknodo --exec $VDRPRG-kbd >/dev/null
+	rm -f $PIDFILE
     else
-       # (assume that vdr-kbd is running)
-       killall -q -TERM /usr/bin/vdr-kbd > /dev/null 2>&1
+    	echo -n " - seems not to be running"
     fi
 }
 
@@ -79,4 +83,3 @@
 esac
 
 exit 0
-




More information about the pkg-vdr-dvb-changes mailing list