[Pkg-utopia-commits] r1351 - packages/unstable/dbus/debian

Michael Biebl biebl at alioth.debian.org
Thu Apr 12 23:06:38 UTC 2007


Author: biebl
Date: 2007-04-12 23:06:38 +0000 (Thu, 12 Apr 2007)
New Revision: 1351

Modified:
   packages/unstable/dbus/debian/changelog
   packages/unstable/dbus/debian/dbus.init
Log:
Add functionality to the dbus init script to start/stop dependent services based on the LSB header.
This method is now preferred over /etc/dbus-1/event.d


Modified: packages/unstable/dbus/debian/changelog
===================================================================
--- packages/unstable/dbus/debian/changelog	2007-04-12 22:53:12 UTC (rev 1350)
+++ packages/unstable/dbus/debian/changelog	2007-04-12 23:06:38 UTC (rev 1351)
@@ -10,8 +10,14 @@
     + Add myself to Uploaders.
   * debian/watch
     + Added. Allows to track upstream releases.
+  * debian/dbus.init
+    + Add functionality to start/stop dbus dependent services based on their 
+      LSB header.
+      Instead of installing an init script into /etc/dbus-1/event.d, services
+      depending on dbus should from now on install a regular sysv init script
+      and add an LSB header with "Required-Start: dbus".
 
- -- Michael Biebl <biebl at debian.org>  Fri, 13 Apr 2007 00:51:41 +0200
+ -- Michael Biebl <biebl at debian.org>  Fri, 13 Apr 2007 00:56:54 +0200
 
 dbus (1.0.2-1) unstable; urgency=high
 

Modified: packages/unstable/dbus/debian/dbus.init
===================================================================
--- packages/unstable/dbus/debian/dbus.init	2007-04-12 22:53:12 UTC (rev 1350)
+++ packages/unstable/dbus/debian/dbus.init	2007-04-12 23:06:38 UTC (rev 1351)
@@ -43,6 +43,35 @@
   fi
 }
 
+dependent_services()
+{
+  # Do nothing if we are called by init
+  [ ! -z $runlevel ] && return 
+
+  # Determine current runlevel
+  r=$(/sbin/runlevel)
+  r=${r#*\ }
+  
+  if [ "$1" = "stop" ] ; then
+    param="--reverse"
+    action="stop"
+  else
+    action="start"
+  fi
+
+  # Get the list of services active in this runlevel
+  services=$(grep -l "^# Required-Start:.*dbus" /etc/rc${r}.d/S??* | sort $param)
+
+  # Start the services in the correct order
+  for i in $services ; do
+    service=$(basename $i)
+    service=${service#S??}
+    invoke-rc.d $service $action
+  done
+
+}
+
+
 start_it_up()
 {
   if [ ! -d $PIDDIR ]; then
@@ -68,10 +97,12 @@
   if [ -d $EVENTDIR ]; then
       run-parts --arg=start $EVENTDIR || true
   fi
+  dependent_services start
 }
 
 shut_it_down()
 {
+  dependent_services stop
   if [ -d $EVENTDIR ]; then
       run-parts --reverse --arg=stop $EVENTDIR || true
   fi




More information about the Pkg-utopia-commits mailing list