Code

sysdbd: Send SIGINT to backend thread when shutting down.
[sysdb.git] / src / daemon / sysdbd.c
index 16cac49445daeccf032cc42bce89f6a7ce2c47d2..67d4515600f469f7806129822a128863a67948e7 100644 (file)
@@ -105,7 +105,7 @@ exit_version(void)
        printf("SysDBd version "SDB_VERSION_STRING SDB_VERSION_EXTRA", "
                        "built "BUILD_DATE"\n"
                        "using libsysdb version %s%s\n"
-                       "Copyright (C) 2012 "PACKAGE_MAINTAINER"\n"
+                       "Copyright (C) 2012-2013 "PACKAGE_MAINTAINER"\n"
 
                        "\nThis is free software under the terms of the BSD license, see "
                        "the source for\ncopying conditions. There is NO WARRANTY; not "
@@ -171,6 +171,7 @@ static void *
 backend_handler(void __attribute__((unused)) *data)
 {
        sdb_plugin_collector_loop(&plugin_main_loop);
+       sdb_log(SDB_LOG_INFO, "Shutting down backend thread");
        return NULL;
 } /* backend_handler */
 
@@ -281,6 +282,7 @@ main(int argc, char **argv)
 
                sdb_log(SDB_LOG_INFO, "Waiting for backend thread to terminate");
                plugin_main_loop.do_loop = 0;
+               pthread_kill(backend_thread, SIGINT);
                pthread_join(backend_thread, NULL);
                sdb_fe_sock_destroy(sock);
        }