We should probably log and ignore config files we fail to parse, instead of aborting entirely. A lot of different software drops config files there, and it's a rather bad failure condition since your system becomes effectively unbootable.
This appears to be <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230231> for which we've had a patch since 2004. At the time it was intended to be temporary; I'm not sure whether it was upstreamed and rejected, or just not upstreamed on the assumption that the need for it would go away. Anyway, I agree with your rationale and would like to apply the patch. Any objections?
Created attachment 41714 [details] [review] Quiesce error reports in system.d/*.conf files when loading Originally from Daniel Silverstone, dating back to the 0.20-6 Debian package.
Comment on attachment 41714 [details] [review] Quiesce error reports in system.d/*.conf files when loading >+ _dbus_warn("\nEncountered error '%s' while parsing '%s'\n", Missing space between identifer and paren. >+ error->message, >+ _dbus_string_get_const_data(&full_path)); Ditto.
Comment on attachment 41714 [details] [review] Quiesce error reports in system.d/*.conf files when loading >+ _dbus_warn("\nEncountered error '%s' while parsing '%s'\n", >+ error->message, >+ _dbus_string_get_const_data(&full_path)); _dbus_warn isn't quite right for this; in a normal scenario (system bus or session bus) it just gets lost to the void, at least on most general purpose Linux forks I know of. We should at least attempt to protest in a meaningful way by using e.g.: bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Error in config file: %s", error->message); (This uses syslog)
Reasonable objections. A revised patch is on my to-do list.
Created attachment 42762 [details] [review] If a file included via <includedir/> is invalid, syslog and skip it This is more graceful than failing entirely (our previous behaviour), but more visible than ignoring it completely (the previous behaviour patched in by Debian and derivatives). Based on a patch from Daniel Silverstone back in 2004, which was meant to be temporary; I think it makes sense to change this permanently, since files in *.d are typically supplied by other packages, whose bugs shouldn't be able to bring down dbus-daemon. --- Unfortunately, I can't call bus_context_log() here; we haven't written our configuration into the bus context at that point, because we're in the config parser! So, I'm just logging it to syslog unconditionally. Unless you have a better idea?
Review of attachment 42762 [details] [review]: This looks like a useful improvement. The only downside I see here is that in our default configuration, the session bus is configured not to syslog, but on the other hand, basically no software puts files in /etc/dbus-1/session.d either.
Thanks, merged to dbus-1.4 (currently just a copy of master) and master. Fixed in git for 1.4.4, 1.5.0.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.