From 3444423394c46d1f8b6b352d817d11a59991fc16 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 26 Jun 2014 19:08:32 +0200 Subject: [PATCH] On termination shutdown thread server --- bacula/src/stored/stored.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index aaff80b390..e82f53ffd0 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -60,6 +60,7 @@ static uint32_t VolSessionId = 0; uint32_t VolSessionTime; char *configfile = NULL; bool init_done = false; +static pthread_t server_tid; /* Global static variables */ static bool foreground = 0; @@ -269,6 +270,7 @@ int main (int argc, char *argv[]) init_jcr_subsystem(); /* start JCR watchdogs etc. */ /* Single server used for Director and File daemon */ + server_tid = pthread_self(); bnet_thread_server(me->sdaddrs, me->max_concurrent_jobs * 2 + 1, &dird_workq, handle_connection_request); exit(1); /* to keep compiler quiet */ @@ -673,6 +675,7 @@ void terminate_stored(int sig) } } + bnet_stop_thread_server(server_tid); if (configfile) { free(configfile); configfile = NULL; -- 2.39.5