[Pkg-utopia-commits] r3757 - in /packages/experimental/hal/debian: changelog hal.postinst

biebl at users.alioth.debian.org biebl at users.alioth.debian.org
Wed Nov 17 19:46:24 UTC 2010


Author: biebl
Date: Wed Nov 17 19:45:52 2010
New Revision: 3757

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=3757
Log:
  - debian/hal.postinst: Remove init.d/default/rc.d files on upgrade.
  - debian/hal.postinst: When being triggered by an .fdi file update, query
    D-Bus to get the main pid. If hald is running kill the process and
    restart it via D-Bus activation.

Modified:
    packages/experimental/hal/debian/changelog
    packages/experimental/hal/debian/hal.postinst

Modified: packages/experimental/hal/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/experimental/hal/debian/changelog?rev=3757&op=diff
==============================================================================
--- packages/experimental/hal/debian/changelog (original)
+++ packages/experimental/hal/debian/changelog Wed Nov 17 19:45:52 2010
@@ -7,6 +7,10 @@
       via systemd.
     - Install both via debian/hal.install, create a symlink for hal.service so
       it is enabled by default when using systemd.
+    - debian/hal.postinst: Remove init.d/default/rc.d files on upgrade.
+    - debian/hal.postinst: When being triggered by an .fdi file update, query
+      D-Bus to get the main pid. If hald is running kill the process and
+      restart it via D-Bus activation.
 
  -- Michael Biebl <biebl at debian.org>  Wed, 17 Nov 2010 10:23:43 +0100
 

Modified: packages/experimental/hal/debian/hal.postinst
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/experimental/hal/debian/hal.postinst?rev=3757&op=diff
==============================================================================
--- packages/experimental/hal/debian/hal.postinst (original)
+++ packages/experimental/hal/debian/hal.postinst Wed Nov 17 19:45:52 2010
@@ -23,6 +23,15 @@
 #     installation fails and the `postinst' is called with `abort-upgrade',
 #     `abort-remove' or `abort-deconfigure'.
 
+get_pid() {
+    [ -n "$1" ] || return 0
+    [ -S /var/run/dbus/system_bus_socket ] || return 0
+
+    dbus-send --system --dest=org.freedesktop.DBus --print-reply \
+              /org/freedesktop/DBus org.freedesktop.DBus.GetConnectionUnixProcessID \
+              string:$1 2>/dev/null | awk '/uint32/ {print $2}'
+}
+
 case "$1" in
   configure)
     adduser --system \
@@ -36,9 +45,10 @@
     addgroup --system --quiet plugdev || true
     addgroup --system --quiet powerdev || true
 
-    # Remove old stop symlinks on upgrades
-    if dpkg --compare-versions "$2" lt-nl "0.5.11-6"; then
-      rm -f /etc/rc[06].d/K??hal
+    # Remove old SysV init scripts, using D-Bus activation now
+    if dpkg --compare-versions "$2" lt-nl "0.5.14-4"; then
+      rm -f /etc/init.d/hal /etc/default/hal
+      update-rc.d -f hal remove >/dev/null
     fi
 
     # Update haldaemon home directory
@@ -72,8 +82,11 @@
   triggered)
     echo "Regenerating hal fdi cache ..."
     rm -f /var/cache/hald/fdi-cache
-    if [ -e /var/run/hald/hald.pid ]; then
-      invoke-rc.d hal restart || true
+    # restart hald if it was running before
+    pid=$(get_pid org.freedesktop.Hal)
+    if [ -n "$pid" ]; then
+        kill $pid 2>/dev/null || true
+        lshal >/dev/null || true # will trigger through D-Bus activation
     fi
     exit 0
   ;;




More information about the Pkg-utopia-commits mailing list