int use_syslog;
char *config_file;
int enable_dbus;
+ int fail_on_missing_dbus;
int drop_root;
int publish_resolv_conf;
char ** publish_dns_servers;
c->server_config.check_response_ttl = is_yes(p->value);
else if (strcasecmp(p->key, "use-iff-running") == 0)
c->server_config.use_iff_running = is_yes(p->value);
- else if (strcasecmp(p->key, "enable-dbus") == 0)
- c->enable_dbus = is_yes(p->value);
+ else if (strcasecmp(p->key, "enable-dbus") == 0) {
+
+ if (*(p->value) == 'w' || *(p->value) == 'W') {
+ c->fail_on_missing_dbus = 0;
+ c->enable_dbus = 1;
+ } else if (*(p->value) == 'y' || *(p->value) == 'Y') {
+ c->fail_on_missing_dbus = 1;
+ c->enable_dbus = 1;
+ } else {
+ c->enable_dbus = 0;
+ }
+ }
else if (strcasecmp(p->key, "drop-root") == 0)
c->drop_root = is_yes(p->value);
else {
if (simple_protocol_setup(poll_api) < 0)
goto finish;
-
+ if (c->enable_dbus) {
#ifdef HAVE_DBUS
- if (c->enable_dbus)
- if (dbus_protocol_setup(poll_api) < 0)
- goto finish;
+ if (dbus_protocol_setup(poll_api) < 0) {
+
+ if (c->fail_on_missing_dbus)
+ goto finish;
+
+ avahi_log_warn("WARNING: Failed to contact D-BUS daemon, disabling D-BUS support.");
+ c->enable_dbus = 0;
+ }
+#else
+ avahi_log_warn("WARNING: We are configured to enable D-BUS but it was not compiled in");
#endif
+ }
load_resolv_conf(c);
static_service_load();
config.command = DAEMON_RUN;
config.daemonize = 0;
config.config_file = NULL;
+#ifdef HAVE_DBUS
config.enable_dbus = 1;
+ config.fail_on_missing_dbus = 1;
+#endif
config.drop_root = 1;
config.publish_dns_servers = NULL;
config.publish_resolv_conf = 0;