inotify regression in dbus 1.1.20 (with patch)

Bug #221834 reported by John Carr
6
Affects Status Importance Assigned to Milestone
dbus (Ubuntu)
Fix Released
Medium
Martin Pitt
Hardy
Fix Released
Undecided
Martin Pitt

Bug Description

Binary package hint: dbus

** This will hurt anything that installs files to /etc/dbus-1/system.d/ **

This bug was discovered after a large influx of users into #synce following the Hardy release. In Gutsy, the SynCE PPA worked just fine. However, when Hardy was released we started having trouble with one of the packages that needed to install a file to /etc/dbus-1/system.d/. We quickly worked out dbus needed a restart before the new system.d file would be loaded. This was not the case with Gutsy - so this is a regression.

Our contact at Mandriva was quick to tell us of a problem they had with dbus 1.1.20 and link us to the patch. This was fixed in OpenSuse and Mandriva very quickly, and the patch is quite small. Without this patch the odccm package needs to restart dbus to install cleanly, which I consider to be a bad thing. Apparently this was fixed so quickly elsewhere that there isn't a bug #, either for Mandriva or dbus.

The patch can be found at:
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/dbus/current/SOURCES/dbus-1.1.20-fixmonitor.patch?revision=190617&view=markup&pathrev=190617

Please see below for a better description of what is going on:
http://thread.gmane.org/gmane.comp.freedesktop.dbus/9182

TEST CASE:

Simulate uninstalled nm-applet:
  killall nm-applet
  sudo mv /etc/dbus-1/system.d/nm-applet.conf /tmp
  sudo /etc/init.d/dbus force-reload

Now, if you start nm-applet from a Terminal, you'll see an error message that it cannot connect to dbus:

nma_dbus_init(): could not acquire its service. dbus_bus_acquire_service() says: 'Connection ":1.56" is not allowed to own the service "org.freedesktop.NetworkManagerInfo" due to security policies in the configuration file'

Now move back the configuration:

  sudo mv /tmp/nm-applet.conf /etc/dbus-1/system.d/

With the current Hardy dbus, nm-applet will still fail to start. With the fixed version in hardy-proposed, it will work immediately.
Please keep in mind that you need to reboot after you installed the dbus update (or at least do sudo /etc/init.d/dbus restart, which will break your session somewhat, though.)

Related branches

John Carr (johncarr)
description: updated
Revision history for this message
John Carr (johncarr) wrote :

Rolled the Mandriva patch as a debdiff.

Revision history for this message
John Carr (johncarr) wrote :

Add a patch to debian/patches/ instead of patching source

Revision history for this message
John Carr (johncarr) wrote :

Patched dbus available in my PPA (https://launchpad.net/~jc2k/+archive). This seems to fix it, and my PC hasn't exploded yet :-)

To test, i used the gutsy odccm from https://edge.launchpad.net/~synce/+archive. (This doesn't have the dbus-restart workaround).

I purged odccm from my system and restarted dbus. On attempting to install odccm, it errored.

I purged odccm from my system, upgraded dbus with my PPA. On attempting to install the same odccm, it worked just fine.

Revision history for this message
Adam Williamson (awilliamson) wrote :

+1, this should really be fixed. restarting dbus isn't really a viable workaround, as many applications barf when dbus is restarted under them, restarting dbus on a running system isn't something you really want to do. The patch is simple and was integrated upstream in dbus 1.2.x , there's no problems with it.

Revision history for this message
Martin Pitt (pitti) wrote :

Indeed restarting dbus is a very bad thing and should't be done at all. force-reload *should* suffice, though, so packages depending on dbus could use that. But I'm not opposed to fixing this in hardy, and of course we'll fix it in intrepid.

Changed in dbus:
assignee: nobody → pitti
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → pitti
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed upstream in 1.2.1, merging to intrepid now.

Changed in dbus:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dbus - 1.2.1-2ubuntu1

---------------
dbus (1.2.1-2ubuntu1) intrepid; urgency=low

  * Merge with Debian unstable. Remaining Ubuntu changes:
    - debian/patches/81-session.conf-timeout.patch: Raise the service startup
      timeout from 25 to 60 seconds. It may be too short on the live CD with
      slow machines.
    - debian/dbus.postinst: Do not restart dbus on upgrades, since it breaks
      too many applications. Instead, trigger a "reboot required" notification.
    - debian/rules: Do not install /etc/X11/Xsession.d/75dbus_dbus-launch, we
      do not need it for Gnome, KDE, and XFCE, and it causes trouble.
      (LP #62163)
   * New upstream release fixes overly aggressive inotifying of /etc/dbus-1/.
     (LP: #221834)

dbus (1.2.1-2) unstable; urgency=low

  [ Sjoerd Simons ]
  * debian/rules: Disable the disabling of the userdb cache. No other
    distribution disables it and it is somewhat buggy (Thanks to Scott James
    Remnant for pointing out this issue)

dbus (1.2.1-1) unstable; urgency=low

  * New upstream release.
  * debian/rules, debian/dbus.postinst
    - Minimize downtime of the system message bus (and dependent D-Bus
      services) by restarting dbus in postinst instead of stop in prerm and
      start in postinst. (Closes: #428669)
  * debian/libdbus-1-3.symbols
    - Add symbols file for improved shared library dependencies.
  * debian/shlibs.local
    - This file has been neglected for quite some time and has been
      obsoleted by the symbols file so better remove it.

 -- Martin Pitt <email address hidden> Tue, 06 May 2008 13:34:19 +0200

Changed in dbus:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

I uploaded this patch to the hardy-proposed queue. Steve, can you please process it?

I tested it with the TEST CASE I added to the description.

description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

Accepted into -proposed, please test and give feedback here

Changed in dbus:
status: In Progress → Fix Committed
Revision history for this message
Sebastien Bacher (seb128) wrote :

using the hardy version I can trigger the bug described, after installing the update nm-applet works correctly when moving back the configuration

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in dbus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.