summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4303e1)
raw | patch | inline | side by side (parent: e4303e1)
author | octo <octo> | |
Sat, 17 Dec 2005 19:08:31 +0000 (19:08 +0000) | ||
committer | octo <octo> | |
Sat, 17 Dec 2005 19:08:31 +0000 (19:08 +0000) |
Added SIGTERM handler
Updated `ChangeLog'
Updated `ChangeLog'
ChangeLog | patch | blob | history | |
configure.in | patch | blob | history | |
src/collectd.c | patch | blob | history | |
src/mysql.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index f6a591f34b45f48ee3767ccd93c18fefb3bcc849..7bffaa822416d6a42460e055eec47cd620b49e62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2005-12-17, Version 3.6.0
+ * A config file has been added. This allows for loading only specific
+ plugins.
+ * A `mysql' plugin has been added.
+ * A signal handler for SIGTERM has been added.
+
2005-12-07, Version 3.5.0 (Revision 326)
* A bug in the `load' module under Solaris has been fixed.
* The `users' module has been contributed by Sebastian Harl. It counts
diff --git a/configure.in b/configure.in
index 8d90a9e66e9fa8380d648258920be83489e99282..15903be9e89a03579bc5faf7b0d3b952f072084b 100644 (file)
--- a/configure.in
+++ b/configure.in
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.5.0)
+AC_INIT(collectd, 3.6.alpha0)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
diff --git a/src/collectd.c b/src/collectd.c
index c86a67803ade6fd7b686de0d67007a9316a9b9e1..e8081785564cacc572cb5161907d48166606aa7b 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
loop++;
}
+static void sigTermHandler (int signal)
+{
+ loop++;
+}
+
static int change_basedir (char *dir)
{
int dirlen = strlen (dir);
int main (int argc, char **argv)
{
- struct sigaction sigIntAction, sigChldAction;
+ struct sigaction sigIntAction;
+ struct sigaction sigTermAction;
+ struct sigaction sigChldAction;
char *configfile = CONFIGFILE;
char *plugindir = PLUGINDIR;
char *datadir = PKGLOCALSTATEDIR;
sigIntAction.sa_handler = sigIntHandler;
sigaction (SIGINT, &sigIntAction, NULL);
+ sigIntAction.sa_handler = sigTermHandler;
+ sigaction (SIGTERM, &sigTermAction, NULL);
+
sigChldAction.sa_handler = SIG_IGN;
sigaction (SIGCHLD, &sigChldAction, NULL);
diff --git a/src/mysql.c b/src/mysql.c
index 1ac62e9809e34077e455cdf85d8c00bd9fdf1ab3..bd9685b632b56a629642392ebd30855126e88407 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
#define BUFSIZE 512
-static char *host;
+static char *host = "localhost";
static char *user;
static char *pass;
static char *db = NULL;
if (getconnection () != NULL)
init_suceeded = 1;
else
+ {
+ syslog (LOG_ERR, "The `mysql' plugin will be disabled because `init' failed to connect to `%s'", host);
init_suceeded = 0;
+ }
#endif /* MYSQL_HAVE_READ */
return;