goto error;
}
+ VIR_DEBUG("Registering unix socket %s", sock_path);
if (!(svc = virNetServerServiceNewUNIX(sock_path,
unix_sock_rw_mask,
unix_sock_gid,
config->max_client_requests,
NULL)))
goto error;
- if (sock_path_ro &&
- !(svcRO = virNetServerServiceNewUNIX(sock_path_ro,
- unix_sock_ro_mask,
- unix_sock_gid,
- config->auth_unix_ro,
- true,
- config->max_client_requests,
- NULL)))
- goto error;
+ if (sock_path_ro) {
+ VIR_DEBUG("Registering unix socket %s", sock_path_ro);
+ if (!(svcRO = virNetServerServiceNewUNIX(sock_path_ro,
+ unix_sock_ro_mask,
+ unix_sock_gid,
+ config->auth_unix_ro,
+ true,
+ config->max_client_requests,
+ NULL)))
+ goto error;
+ }
if (virNetServerAddService(srv, svc,
config->mdns_adv && !ipsock ?
if (ipsock) {
if (config->listen_tcp) {
+ VIR_DEBUG("Registering TCP socket %s:%s",
+ config->listen_addr, config->tcp_port);
if (!(svcTCP = virNetServerServiceNewTCP(config->listen_addr,
config->tcp_port,
config->auth_tcp,
goto error;
}
+ VIR_DEBUG("Registering TLS socket %s:%s",
+ config->listen_addr, config->tls_port);
if (!(svcTLS =
virNetServerServiceNewTCP(config->listen_addr,
config->tls_port,
}
if (!privileged &&
- migrateProfile() < 0)
+ migrateProfile() < 0) {
+ VIR_ERROR(_("Exiting due to failure to migrate profile"));
exit(EXIT_FAILURE);
+ }
if (config->host_uuid &&
virSetHostUUIDStr(config->host_uuid) < 0) {
VIR_ERROR(_("Can't determine pid file path."));
exit(EXIT_FAILURE);
}
+ VIR_DEBUG("Decided on pid file path '%s'", NULLSTR(pid_file));
if (daemonUnixSocketPaths(config,
privileged,
VIR_ERROR(_("Can't determine socket paths"));
exit(EXIT_FAILURE);
}
+ VIR_DEBUG("Decided on socket paths '%s' and '%s'",
+ sock_file, NULLSTR(sock_file_ro));
if (godaemon) {
char ebuf[1024];
old_umask = umask(022);
else
old_umask = umask(077);
+ VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
if (virFileMakePath(run_dir) < 0) {
char ebuf[1024];
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
/* Beyond this point, nothing should rely on using
* getuid/geteuid() == 0, for privilege level checks.
*/
+ VIR_DEBUG("Dropping privileges (if required)");
if (daemonSetupPrivs() < 0) {
ret = VIR_DAEMON_ERR_PRIVS;
goto cleanup;
goto cleanup;
}
- if (timeout != -1)
+ if (timeout != -1) {
+ VIR_DEBUG("Registering shutdown timeout %d", timeout);
virNetServerAutoShutdown(srv,
timeout,
daemonShutdownCheck,
NULL);
+ }
if ((daemonSetupSignals(srv)) < 0) {
ret = VIR_DAEMON_ERR_SIGNAL;
}
if (config->audit_level) {
+ VIR_DEBUG("Attempting to configure auditing subsystem");
if (virAuditOpen() < 0) {
if (config->audit_level > 1) {
ret = VIR_DAEMON_ERR_AUDIT;
goto cleanup;
}
+ VIR_DEBUG("Proceeding without auditing");
}
}
virAuditLog(config->audit_logging);
* Returns 0 if all succeed, -1 upon any failure.
*/
int virStateInitialize(int privileged) {
- int i, ret = 0;
+ int i;
if (virInitialize() < 0)
return -1;
for (i = 0 ; i < virStateDriverTabCount ; i++) {
- if (virStateDriverTab[i]->initialize &&
- virStateDriverTab[i]->initialize(privileged) < 0) {
- VIR_ERROR(_("Initialization of %s state driver failed"),
+ if (virStateDriverTab[i]->initialize) {
+ VIR_DEBUG("Running global init for %s state driver",
virStateDriverTab[i]->name);
- ret = -1;
+ if (virStateDriverTab[i]->initialize(privileged) < 0) {
+ VIR_ERROR(_("Initialization of %s state driver failed"),
+ virStateDriverTab[i]->name);
+ return -1;
+ }
}
}
- return ret;
+ return 0;
}
/**