rev 6697 - trunk/packages/kdenetwork/debian

Sune Vuorela pusling-guest at alioth.debian.org
Fri Jul 6 21:38:43 UTC 2007


Author: pusling-guest
Date: 2007-07-06 21:38:43 +0000 (Fri, 06 Jul 2007)
New Revision: 6697

Modified:
   trunk/packages/kdenetwork/debian/changelog
   trunk/packages/kdenetwork/debian/lisa.init
Log:
fixup lisa init script


Modified: trunk/packages/kdenetwork/debian/changelog
===================================================================
--- trunk/packages/kdenetwork/debian/changelog	2007-07-06 16:37:44 UTC (rev 6696)
+++ trunk/packages/kdenetwork/debian/changelog	2007-07-06 21:38:43 UTC (rev 6697)
@@ -1,3 +1,12 @@
+kdenetwork (4:3.5.7-2) unstable; urgency=low
+
+  +++ Changes by Sune Vuorela:
+
+  * Add lsb info to lisa init script.
+  * Don't do anything if lisa is already running. (Closes: #407892)
+
+ -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Fri, 06 Jul 2007 23:13:17 +0200
+
 kdenetwork (4:3.5.7-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/packages/kdenetwork/debian/lisa.init
===================================================================
--- trunk/packages/kdenetwork/debian/lisa.init	2007-07-06 16:37:44 UTC (rev 6696)
+++ trunk/packages/kdenetwork/debian/lisa.init	2007-07-06 21:38:43 UTC (rev 6697)
@@ -1,5 +1,13 @@
 #! /bin/sh
+### BEGIN INIT INFO
+# Provides:          lisa
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+### END INIT INFO
 
+
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/sbin/lisa
 NAME=lisa
@@ -10,8 +18,33 @@
 
 set -e
 
+is_running ()
+{
+	if [ -e "$PIDFILE" ]
+	then
+		#checking if program is running
+		if [ -L /proc/`cat $PIDFILE`/exe ]
+		then
+		#checking for stale pidfile
+			if grep -q $NAME /proc/`cat $PIDFILE`/cmdline 
+			then
+				#program is running and is called lisa
+				return 0
+			fi
+		fi
+		rm -f $PIDFILE
+	fi
+	#program is not running
+	return 1
+}
+
 case "$1" in
   start)
+  	if is_running
+	then
+		echo "$DESC is already running. Not doing anything"
+		exit 0
+	fi
 	echo -n "Starting $DESC: "
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
 		> /dev/null
@@ -19,6 +52,11 @@
 	echo "$NAME."
 	;;
   stop)
+  	if ! is_running
+	then
+		echo "$DESC is not running. Not doing anything"
+		exit 0
+	fi
 	echo -n "Stopping $DESC: "
 	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
 		--exec $DAEMON
@@ -30,6 +68,15 @@
 	start-stop-daemon --stop --quiet --signal 1 --pidfile $PIDFILE \
 		--exec $DAEMON
 	;;
+  status)
+	echo -n "$DESC is "
+	if ! is_running
+	then 
+		echo -n "not "
+	fi
+	echo "running."
+
+  	;;
   restart)
 	echo -n "Restarting $DESC: "
 	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
@@ -41,9 +88,25 @@
 	echo $(pidof lisa) > $PIDFILE
 	echo "$NAME."
 	;;
+  cond-restart)
+  	if ! is_running
+	then
+		echo "$DESC is not running. Not doing anything"
+		exit 0
+	fi
+	echo -n "Restarting $DESC: "
+	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
+		--exec $DAEMON
+	rm -f $PIDFILE
+	sleep 1
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
+		> /dev/null
+	echo $(pidof lisa) > $PIDFILE
+	echo "$NAME."
+	;;
   *)
 	N=/etc/init.d/$NAME
-	echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $N {start|stop|restart|cond-restart|status|reload|force-reload}" >&2
 	exit 1
 	;;
 esac




More information about the pkg-kde-commits mailing list