diff --git a/src/daemon/sysdbd.c b/src/daemon/sysdbd.c
index fa314909fef5ed26dbcc6ae6da783333ed08a684..f1992610f2a2164af9d189c8f1324ea6a3265daf 100644 (file)
--- a/src/daemon/sysdbd.c
+++ b/src/daemon/sysdbd.c
#include "sysdb.h"
#include "core/plugin.h"
#include "core/store.h"
-#include "utils/error.h"
+#include "core/error.h"
#include "daemon/config.h"
if ((pid = fork()) < 0) {
char errbuf[1024];
- sdb_log(SDB_LOG_ERR, "Failed to fork to background: %s\n",
+ sdb_log(SDB_LOG_ERR, "Failed to fork to background: %s",
sdb_strerror(errno, errbuf, sizeof(errbuf)));
return errno;
}
if (chdir("/")) {
char errbuf[1024];
sdb_log(SDB_LOG_ERR, "Failed to change working directory to "
- "the root directory: %s\n",
+ "the root directory: %s",
sdb_strerror(errno, errbuf, sizeof(errbuf)));
return errno;
}
close(0);
if (open("/dev/null", O_RDWR)) {
char errbuf[1024];
- sdb_log(SDB_LOG_ERR, "Failed to connect stdin to '/dev/null': "
- "%s\n", sdb_strerror(errno, errbuf, sizeof(errbuf)));
+ sdb_log(SDB_LOG_ERR, "Failed to connect stdin to '/dev/null': %s",
+ sdb_strerror(errno, errbuf, sizeof(errbuf)));
return errno;
}
close(1);
if (dup(0) != 1) {
char errbuf[1024];
- sdb_log(SDB_LOG_ERR, "Could not connect stdout to '/dev/null': "
- "%s\n", sdb_strerror(errno, errbuf, sizeof(errbuf)));
+ sdb_log(SDB_LOG_ERR, "Could not connect stdout to '/dev/null': %s",
+ sdb_strerror(errno, errbuf, sizeof(errbuf)));
return errno;
}
close(2);
if (dup(0) != 2) {
char errbuf[1024];
- sdb_log(SDB_LOG_ERR, "Could not connect stderr to '/dev/null': "
- "%s\n", sdb_strerror(errno, errbuf, sizeof(errbuf)));
+ sdb_log(SDB_LOG_ERR, "Could not connect stderr to '/dev/null': %s",
+ sdb_strerror(errno, errbuf, sizeof(errbuf)));
return errno;
}
return 0;
config_filename = CONFIGFILE;
if (daemon_parse_config(config_filename)) {
- sdb_log(SDB_LOG_ERR, "Failed to parse configuration file.\n");
+ sdb_log(SDB_LOG_ERR, "Failed to parse configuration file.");
exit(1);
}
if (sigaction(SIGINT, &sa_intterm, /* old action */ NULL)) {
char errbuf[1024];
sdb_log(SDB_LOG_ERR, "Failed to install signal handler for "
- "SIGINT: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf)));
+ "SIGINT: %s", sdb_strerror(errno, errbuf, sizeof(errbuf)));
exit(1);
}
if (sigaction(SIGTERM, &sa_intterm, /* old action */ NULL)) {
char errbuf[1024];
sdb_log(SDB_LOG_ERR, "Failed to install signal handler for "
- "SIGTERM: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf)));
+ "SIGTERM: %s", sdb_strerror(errno, errbuf, sizeof(errbuf)));
exit(1);
}
exit(1);
sdb_log(SDB_LOG_INFO, "SysDB daemon "SDB_VERSION_STRING
- SDB_VERSION_EXTRA " (pid %i) initialized successfully\n",
+ SDB_VERSION_EXTRA " (pid %i) initialized successfully",
(int)getpid());
sdb_plugin_init_all();
+ plugin_main_loop.default_interval = SECS_TO_SDB_TIME(60);
sdb_plugin_collector_loop(&plugin_main_loop);
sdb_log(SDB_LOG_INFO, "Shutting down SysDB daemon "SDB_VERSION_STRING
- SDB_VERSION_EXTRA" (pid %i)\n", (int)getpid());
+ SDB_VERSION_EXTRA" (pid %i)", (int)getpid());
fprintf(stderr, "Store dump:\n");
sdb_store_dump(stderr);