Opened 12 years ago

Last modified 12 years ago

#35653 new defect

gconf 2.28.1_3 +quartz connections from client to gconfd fail

Reported by: wagner.sim88@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: haspatch Cc:
Port: gconf

Description

When using the +quartz variant of gconf, the gconfd can't be reached by the clients.

The error message is: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Not running within active session)

Apparently the following lines in gconf-internals.c at the function get_ior are causing the issue:

/* if the bus isn't running and we don't want to start gconfd then
         * we don't want to autolaunch the bus either, so bail early.
         */
        if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL &&
           (!start_if_not_found || g_getenv ("DISPLAY") == NULL)) {
                if (failure_log)
                    g_string_append_printf (failure_log,
                                            _("Not running within active session"));
                return NULL;
        }

As DBUS_SESSION_BUS_ADDRESS is not set (because dbus is started via launchd and does set DBUS_LAUNCHD_SESSION_BUS_SOCKET but not DBUS_SESSION_BUS_ADDRESS) and no DISPLAY is available (as we are using quartz and not X11) the expression evaluates to true and the gconf client thinks, that dbus is not available and quits.

I fixed this by testing, wether DBUS_LAUNCHD_SESSION_BUS_SOCKET is set

g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL && g_getenv ("DBUS_LAUNCHD_SESSION_BUS_SOCKET") == NULL &&
           (!start_if_not_found || g_getenv ("DISPLAY") == NULL)

Please take a look into wether this is the correct way to fix this.

Patch with the fix is attached.

Attachments (1)

patch-gconf-gconf-internals.c.diff (337 bytes) - added by wagner.sim88@… 12 years ago.
patch to gconf to check if dbus has been started via launchd

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by wagner.sim88@…

patch to gconf to check if dbus has been started via launchd

comment:1 Changed 12 years ago by jmroot (Joshua Root)

Keywords: haspatch added

The gconf port has no maintainer, and I don't know enough about gconf to confirm that this fix is correct. Could you ask upstream about it? That way they can also include it in future releases.

comment:2 Changed 12 years ago by jmroot (Joshua Root)

Actually, it looks like the port is outdated compared to the upstream stable release too. So updating it first may be a good idea.

comment:3 Changed 12 years ago by wagner.sim88@…

Well, updating won't help. The latest Gconf release which is still compatible with Gnome 2 is Gconf 2.32.5 and that has the exact same line in gconf-internals.c.

comment:4 Changed 12 years ago by wagner.sim88@…

Bug is reported to upstream under https://bugzilla.gnome.org/show_bug.cgi?id=685509

comment:5 Changed 12 years ago by wagner.sim88@…

Patch has been applied in upstream, should be ok for MacPorts now

Note: See TracTickets for help on using tickets.