New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #15081 (closed defect: fixed)

Opened 5 years ago

Last modified 3 months ago

dbus failure to start after crash

Reported by: ld-temp-q6x8@… Owned by: mcalhoun@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: rhwood@…, olaf@…, akim.demaille@…, dports@…, nicos_pavlov@…, egall@…
Port: dbus

Description (last modified by mcalhoun@…) (diff)

There is already a ticket (#14163) related to this issue, but it hasn't been updated in 2 months and I can't figure out how to annotate it. After a forced reboot, dbus doesn't automatically restart because the PID file, /opt/local/var/run/dbus/pid, doesn't get deleted. Since dbus is running as a launchd job, this file isn't needed and shouldn't exist. The launchd item itself and the system.conf files also need to be changed. There's no need for the dbus.wrapper script, which seems to be a relic of pre-launchd times. dbus-daemon should be called directly from org.macports.dbus.plist, and the lines in system.conf that cause it to drop privileges, fork into the background, and write a PID file should be removed. I'll try to attach proposed replacements for org.macports.dbus.plist and system.conf to this ticket. Thanks.

Attachments

dbus.tbz (1.5 KB) - added by ld-temp-q6x8@… 5 years ago.
dbus config files
patch-bus_system.conf.in.diff (524 bytes) - added by dports@… 3 years ago.
patchfile to stop pidfile creation

Change History

Changed 5 years ago by ld-temp-q6x8@…

dbus config files

comment:1 Changed 5 years ago by rhwood@…

  • Cc rhwood@… added

Cc Me!

comment:2 follow-up: ↓ 3 Changed 5 years ago by rhwood@…

You may want to engage the upstream dbus developers since they are almost all linux developers and launchd is unique to the Mac OS X.

comment:3 in reply to: ↑ 2 Changed 5 years ago by vaulse@…

Replying to rhwood@macports.org:

You may want to engage the upstream dbus developers since they are almost all linux developers and launchd is unique to the Mac OS X.

For that very reason, why would they care? I'm proposing to change the launchd item, which is Mac-specific, and the config file in a Mac-specific way. Only a few lines need to be changed. I've been running dbus this way for months and it works fine.

comment:4 Changed 4 years ago by blb@…

  • Milestone set to Port Bugs

comment:5 Changed 4 years ago by mcalhoun@…

  • Owner changed from macports-tickets@… to mcalhoun@…
  • Description modified (diff)

comment:6 Changed 4 years ago by olaf@…

  • Cc olaf@… added

Cc Me!

comment:7 Changed 4 years ago by mcalhoun@…

  • Status changed from new to closed
  • Resolution set to fixed

This should be fixed in r49300.
Please let me know if there are any problems.

comment:8 follow-up: ↓ 9 Changed 4 years ago by anonymous

  • Milestone Port Bugs deleted

Milestone Port Bugs deleted

comment:9 in reply to: ↑ 8 Changed 4 years ago by akim.demaille@…

Hi all,

I still have the same problem. My system logs are filled with

04/09/09 10:28:56 org.freedesktop.dbus-system[63015] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:28:56 com.apple.launchd[1] (org.freedesktop.dbus-system[63015]) Exited with exit code: 1 
04/09/09 10:28:56 com.apple.launchd[1] (org.freedesktop.dbus-system[63015]) Exited with exit code: 1 
04/09/09 10:28:56 com.apple.launchd[1] (org.freedesktop.dbus-system) Throttling respawn: Will start in 10 seconds 
04/09/09 10:29:06 org.freedesktop.dbus-system[63019] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:06 org.freedesktop.dbus-system[63019] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:06 com.apple.launchd[1] (org.freedesktop.dbus-system[63019]) Exited with exit code: 1 
04/09/09 10:29:06 com.apple.launchd[1] (org.freedesktop.dbus-system) Throttling respawn: Will start in 10 seconds 
04/09/09 10:29:16 org.freedesktop.dbus-system[63021] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:16 org.freedesktop.dbus-system[63021] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:16 com.apple.launchd[1] (org.freedesktop.dbus-system[63021]) Exited with exit code: 1 
04/09/09 10:29:16 com.apple.launchd[1] (org.freedesktop.dbus-system) Throttling respawn: Will start in 10 seconds 
04/09/09 10:29:26 org.freedesktop.dbus-system[63022] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:26 org.freedesktop.dbus-system[63022] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:26 com.apple.launchd[1] (org.freedesktop.dbus-system[63022]) Exited with exit code: 1 
04/09/09 10:29:26 com.apple.launchd[1] (org.freedesktop.dbus-system) Throttling respawn: Will start in 10 seconds 
04/09/09 10:29:36 org.freedesktop.dbus-system[63024] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:36 com.apple.launchd[1] (org.freedesktop.dbus-system[63024]) Exited with exit code: 1 
04/09/09 10:29:36 com.apple.launchd[1] (org.freedesktop.dbus-system) Throttling respawn: Will start in 10 seconds 
04/09/09 10:29:36 com.apple.launchd[1] (org.freedesktop.dbus-system) Throttling respawn: Will start in 10 seconds 
04/09/09 10:29:46 org.freedesktop.dbus-system[63026] Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file 
04/09/09 10:29:46 com.apple.launchd[1] (org.freedesktop.dbus-system[63026]) Exited with exit code: 1 

Once I removed the file, everything is fine.

I'm using

dbus @1.2.14 (devel)
Variants:             darwin_7, no_root, no_startupitem, test, universal

Description:          A message bus system, a simple way for applications to talk to one another.
Homepage:             http://www.freedesktop.org/Software/dbus

Build Dependencies:   pkgconfig, autoconf, automake, libtool
Library Dependencies: expat
Platforms:            darwin
License:              unknown
Maintainers:          mcalhoun@macports.org, openmaintainer@macports.org

Thanks!

comment:10 Changed 4 years ago by akim.demaille@…

  • Cc akim.demaille@… added

Cc Me!

comment:11 Changed 4 years ago by macsforever2000@…

  • Port set to dbus

comment:12 Changed 3 years ago by dports@…

  • Cc dports@… added

Cc Me!

comment:13 Changed 3 years ago by dports@…

I'm running into exactly the same problem with dbus @1.2.16_1:

2010/01/17 03:21:30	org.freedesktop.dbus-system[14253]	Failed to start message bus: The pid file "/opt/local/var/run/dbus/pid" exists, if the message bus is not running, remove this file
2010/01/17 03:21:30	com.apple.launchd[1]	(org.freedesktop.dbus-system[14253]) Exited with exit code: 1
2010/01/17 03:21:30	com.apple.launchd[1]	(org.freedesktop.dbus-system) Throttling respawn: Will start in 10 seconds

I don't quite follow exactly what changed in r49300 that was supposed to fix this.

It seems to me that (as noted above) the pid file isn't necessary under launchd and so it can be disabled by removing the <pidfile> line in /opt/local/etc/dbus-1/system.conf. Indeed, removing this line does get the system bus running again. (Unfortunately, that's not the only problem I'm having with dbus.)

comment:14 follow-up: ↓ 15 Changed 3 years ago by dports@…

I tried to mark this ticket as reopened but didn't have access. It sounds like this problem still exists, and I think it's a pretty important one: some other things fail in pretty mysterious ways if dbus isn't working (see many tickets about gnucash).

I think the best way to deal with this -- and the one I am successfully using now -- is to add --without-system-pid-file to configure.args.

comment:15 in reply to: ↑ 14 Changed 3 years ago by dports@…

Replying to dports@…:

I think the best way to deal with this -- and the one I am successfully using now -- is to add --without-system-pid-file to configure.args.

Uh, I spoke too soon. Although configure claims to accept --without-system-pid-file, if you use it, it actually uses /no (!) as the pidfile instead of /opt/local/var/run/dbus/pid.

OK, I guess the solution is to remove the <pidfile> line from dbus-1/system.conf. Unfortunately, this file is autogenerated so it'll need to be patched in the post-configure or post-build stage rather than using a simple patchfile. I'll create a portfile patch for this.

Changed 3 years ago by dports@…

patchfile to stop pidfile creation

comment:16 follow-up: ↓ 19 Changed 3 years ago by dports@…

Attached a patchfile to system.conf.in that causes it to not create a pidfile.

comment:17 Changed 3 years ago by jmr@…

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:18 Changed 3 years ago by nicos_pavlov@…

  • Cc nicos_pavlov@… added

Cc Me!

comment:19 in reply to: ↑ 16 Changed 3 years ago by adfernandes@…

  • Status changed from reopened to closed
  • Resolution set to fixed

Replying to dports@…:

Attached a patchfile to system.conf.in that causes it to not create a pidfile.

Added and tested the patch from dports@ambulatoryclam.net that changes the system.conf file to not write the pid. Seems to work with apps that need dbus. Committed in r68276.

comment:20 Changed 3 months ago by egall@…

  • Cc egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.