case AVAHI_SERVER_RUNNING:
avahi_log_info("Server startup complete. Host name is %s. Local service cookie is %u.", avahi_server_get_host_name_fqdn(s), avahi_server_get_local_service_cookie(s));
- avahi_set_proc_title("%s: running [%s]", argv0, avahi_server_get_host_name_fqdn(s));
+ avahi_set_proc_title(argv0, "%s: running [%s]", argv0, avahi_server_get_host_name_fqdn(s));
static_service_add_to_server();
static_hosts_add_to_server();
case AVAHI_SERVER_COLLISION: {
char *n;
+ avahi_set_proc_title(argv0, "%s: collision", argv0);
+
static_service_remove_from_server();
static_hosts_remove_from_server();
-
remove_dns_server_entry_groups();
-
+
n = avahi_alternative_host_name(avahi_server_get_host_name(s));
avahi_log_warn("Host name conflict, retrying with <%s>", n);
avahi_server_set_host_name(s, n);
avahi_free(n);
- avahi_set_proc_title("%s: collision", argv0);
-
break;
}
break;
case AVAHI_SERVER_REGISTERING:
- avahi_set_proc_title("%s: registering [%s]", argv0, avahi_server_get_host_name_fqdn(s));
+ avahi_set_proc_title(argv0, "%s: registering [%s]", argv0, avahi_server_get_host_name_fqdn(s));
+
+ static_service_remove_from_server();
+ static_hosts_remove_from_server();
+ remove_dns_server_entry_groups();
+
+ break;
case AVAHI_SERVER_INVALID:
break;
c->server_config.use_ipv6 = is_yes(p->value);
else if (strcasecmp(p->key, "check-response-ttl") == 0)
c->server_config.check_response_ttl = is_yes(p->value);
+ else if (strcasecmp(p->key, "allow-point-to-point") == 0)
+ c->server_config.allow_point_to_point = 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, "disallow-other-stacks") == 0)
} else if (strcasecmp(p->key, "rlimit-stack") == 0) {
c->rlimit_stack_set = 1;
c->rlimit_stack = atoi(p->value);
-#ifdef RLIMIT_NPROC
} else if (strcasecmp(p->key, "rlimit-nproc") == 0) {
+#ifdef RLIMIT_NPROC
c->rlimit_nproc_set = 1;
c->rlimit_nproc = atoi(p->value);
+#else
+ avahi_log_error("Ignoring configuration key \"%s\" in group \"%s\"\n", p->key, g->name);
#endif
} else {
avahi_log_error("Invalid configuration key \"%s\" in group \"%s\"\n", p->key, g->name);
static_hosts_load(0);
#endif
static_service_add_to_server();
- static_service_remove_from_server();
+ static_hosts_add_to_server();
if (resolv_conf_entry_group)
avahi_s_entry_group_reset(resolv_conf_entry_group);
#ifdef HAVE_DBUS
if (c->enable_dbus) {
- if (dbus_protocol_setup(poll_api, config.disable_user_service_publishing) < 0) {
+ if (dbus_protocol_setup(poll_api, config.disable_user_service_publishing, !c->fail_on_missing_dbus
+#ifdef ENABLE_CHROOT
+ && !config.use_chroot
+#endif
+ ) < 0) {
+
+ avahi_log_warn("WARNING: Failed to contact D-Bus daemon.");
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;
}
}
#endif
}
/* If the initialization failed by some reason, we add the time to the seed*/
- seed |= (unsigned) time(NULL);
+ seed ^= (unsigned) time(NULL);
srand(seed);
}
#endif
avahi_log_info("%s "PACKAGE_VERSION" starting up.", argv0);
- avahi_set_proc_title("%s: starting up", argv0);
+ avahi_set_proc_title(argv0, "%s: starting up", argv0);
if (run_server(&config) == 0)
r = 0;