Opened 15 years ago

Closed 15 years ago

#19804 closed defect (invalid)

"sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist" should not sudo?

Reported by: jim@… Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc:
Port: dbus

Description

I've been having a problem that looked very much like #17950; the core symptom was:

Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!

(process:15731): GConf-CRITICAL **: Could not connect to session bus: Not enough memory

Reading through #17950, I got the sense that I wasn't connecting to gconf and was able to confirm this using gconf-editor, first running it as my normal user, then as root. The former gave the same errors as above; the latter ran fine and gave me access to the gconf database. I further confirmed this by running launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET as my normal user (which provided no response) and as root (which provided the proper value).

Here's what I did to get gconf and dbus working:

  1. sudo launchctl unload -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
  2. sudo chown my_user:staff /Library/LaunchAgents/org.freedesktop.dbus-session.plist
  3. launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

After that, all works well. This is in line with the observation in comment:ticket:17950:86 which advises against "sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist".

Change History (4)

comment:1 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Owner: changed from macports-tickets@… to mcalhoun@…
Status: newassigned

dbus is working find for me, so please bear with me in trying to figure out the best solution.

By chance, does the following work:

  • Install dbus without any of your proposed changes.
  • Call launchctl as instructed by the Portfile (using sudo on both launchctl call).
  • Restart your machine.

comment:2 Changed 15 years ago by jim@…

I wonder that as well. I'll try to get some time this weekend to run this down.

comment:3 Changed 15 years ago by jim@…

Freaky. Second time around it works with sudo fine. I can't explain why, though.

Here's what I did:

> sudo port -f uninstall dbus
> sudo launchctl unload -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
> sudo launchctl unload -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
> sudo port install dbus
> sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
> sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
> launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
/tmp/launch-uUXNGR/unix_domain_listener

Works for me. Feel free to close this.

comment:4 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: invalid
Status: assignedclosed

I am glad it is working.
In both cases (you first and most recent posts) which worked, you ran unload on /Library/LaunchAgents/org.freedesktop.dbus-session.plist.
Perhaps that had something to do with it.

Note: See TracTickets for help on using tickets.