Package: consolekit
Version: 0.2.10-2
Severity: normal
Hello,
on a system where ConsoleKit is only used sporadically, a race condition
caused by the interaction between D-Bus' activation code and
console-kit-daemon's backgrounding has surfaced.
If console-kit-daemon backgrounds quickly enough that the D-Bus code hasn't
returned to the caller yet, the caller receives the error "Launch helper
exited with unknown return code 0".
This can be demonstrated by the attached python script.
$ sudo killall /usr/sbin/console-kit-daemon
$ ./test-ck
Unable to use PackageKit: org.freedesktop.DBus.Error.Spawn.ChildExited:
Launch helper exited with unknown return code 0
(You might need to repeat the above steps a few times to reproduce.)
To avoid the race condition, the following change simply disables the
backgrounding in console-kit-daemon for the D-Bus activation case:
--- /usr/share/dbus-1/system-services/org.freedesktop.ConsoleKit.service
2008-12-04 18:17:43.000000000 +0100
+++ /usr/share/dbus-1/system-services/org.freedesktop.ConsoleKit.service
2008-12-04 18:17:34.000000000 +0100
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.ConsoleKit
-Exec=/usr/sbin/console-kit-daemon
+Exec=/usr/sbin/console-kit-daemon --no-daemon
User=root
The alternative would be to fix D-Bus to assume return code 0 is fine, as long
as someone continues to provide the requested service. So maybe this is a bug
in D-Bus and not in ConsoleKit.
Cheers, Fabian
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (100, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)
Kernel: Linux 2.6.18-6-xen-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 consolekit depends on:
ii dbus 1.2.1-4 simple interprocess messaging syst
ii libc6 2.7-16 GNU C Library: Shared libraries
ii libck-connector0 0.2.10-2 ConsoleKit libraries
ii libdbus-1-3 1.2.1-4 simple interprocess messaging syst
ii libdbus-glib-1-2 0.76-1 simple interprocess messaging syst
ii libglib2.0-0 2.16.6-1 The GLib library of C routines
ii libx11-6 2:1.1.5-2 X11 client-side library
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
Versions of packages consolekit recommends:
pn libpam-ck-connector <none> (no description available)
consolekit suggests no packages.
-- no debconf information
#!/usr/bin/python
import dbus
import sys
try:
bus = dbus.SystemBus()
except dbus.DBusException, e:
print 'Unable to connect to dbus: %s' % str(e)
sys.exit()
try:
proxy = bus.get_object('org.freedesktop.ConsoleKit', '/org/freedesktop/ConsoleKit')
iface = dbus.Interface(proxy, 'org.freedesktop.ConsoleKit.Manager')
print 'It worked.'
except dbus.DBusException, e:
print 'Unable to use PackageKit: %s' % str(e)