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);