From: Kern Sibbald Date: Thu, 26 Jun 2014 17:08:32 +0000 (+0200) Subject: On termination shutdown thread server X-Git-Tag: Release-7.0.5~37 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3444423394c46d1f8b6b352d817d11a59991fc16;p=bacula%2Fbacula On termination shutdown thread server --- 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;