[pkg-fso-maint] Bug#514778: fix for wicd install/removal in chroot environments

Steffen Moeller steffen_moeller at gmx.de
Sun Feb 22 11:57:30 UTC 2009


Package: wicd
Version: 1.5.9-1
Followup-For: Bug #514778

Hello,

postinst and postrm check for dbus to be installed. But what they should test for is if the daemon is actually running. Here my proposal for a fix.

Thanks and regards

Steffen

--- postrm.orig 2009-02-22 12:44:14.051995608 +0100
+++ postrm      2009-02-22 12:45:27.951987226 +0100
@@ -25,11 +25,16 @@
         rm -rf /etc/wicd
         rm -rf /var/lib/wicd
         rm -rf /var/log/wicd
-        if [ -x "/etc/init.d/dbus" ]; then
-            if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-                invoke-rc.d dbus force-reload || exit $?
-            else
-                /etc/init.d/dbus force-reload || exit $?
+        if [ -r "/var/run/dbus/pid" ]; then
+            pid=`cat /var/run/dbus/pid`
+            found=`ps aux|grep " $pid "|grep dbus-daemon`
+            if [ -n "$found" ]; then
+               # the dbus is running
+               if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                   invoke-rc.d dbus force-reload || exit $?
+               else
+                   /etc/init.d/dbus force-reload || exit $?
+               fi
             fi
         fi
     ;;

--- postinst.orig       2009-02-22 12:29:58.689003803 +0100
+++ postinst    2009-02-22 12:44:07.223985344 +0100
@@ -23,11 +23,16 @@
        if [ ! $(getent group netdev) ]; then
                adduser --quiet --system netdev
        fi
-        if [ -x "/etc/init.d/dbus" ]; then
-            if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-                invoke-rc.d dbus force-reload || exit $?
-            else
-                /etc/init.d/dbus force-reload || exit $?
+        if [ -r "/var/run/dbus/pid" ]; then
+            pid=`cat /var/run/dbus/pid`
+            found=`ps aux|grep " $pid "|grep dbus-daemon`
+            if [ -n "$found" ]; then
+               # the dbus is running
+               if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                   invoke-rc.d dbus force-reload || exit $?
+               else
+                   /etc/init.d/dbus force-reload || exit $?
+               fi
             fi
         fi
     ;;


-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages wicd depends on:
ii  adduser                     3.110        add and remove users and groups
ii  dhcp3-client                3.1.1-6      DHCP client
ii  ethtool                     6+20080913-1 display or change Ethernet device 
ii  iproute                     20080725-2   networking and traffic control too
ii  net-tools                   1.60-22      The NET-3 networking toolkit
ii  python                      2.5.2-3      An interactive high-level object-o
ii  python-dbus                 0.83.0-1     simple interprocess messaging syst
ii  python-glade2               2.12.1-6     GTK+ bindings: Glade support
ii  python-gtk2                 2.12.1-6     Python bindings for the GTK+ widge
ii  python-support              0.8.7        automated rebuilding support for P
ii  wireless-tools              29-1.1       Tools for manipulating Linux Wirel
ii  wpasupplicant               0.6.4-3      Client support for WPA and WPA2 (I

wicd recommends no packages.

Versions of packages wicd suggests:
ii  pm-utils                      1.2.4-2    utilities and scripts for power ma

-- no debconf information





More information about the pkg-fso-maint mailing list