From: Jim McDonough Date: Tue, 13 May 2008 20:57:01 +0000 (-0400) Subject: Enable winbind child processes to do something with signals, X-Git-Tag: samba-4.0.0alpha6~801^2~1389 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6b0ea8ee341fde28e568f8e1a4f16d9a89425c8;p=thirdparty%2Fsamba.git Enable winbind child processes to do something with signals, in particular closing and reopening logs on SIGHUP. Conflicts: source/winbindd/winbindd.c (This used to be commit 0f7b11accec7df1c0e9a9dc0828a5e0c5ddec4cb) --- diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 1072f8e762b..57eee20f49d 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -795,6 +795,27 @@ static bool remove_idle_client(void) return False; } +/* check if HUP has been received and reload files */ +void winbind_check_sighup(void) +{ + if (do_sighup) { + + DEBUG(3, ("got SIGHUP\n")); + + flush_caches(); + reload_services_file(); + + do_sighup = False; + } +} + +/* check if TERM has been received */ +void winbind_check_sigterm(void) +{ + if (do_sigterm) + terminate(); +} + /* Process incoming clients on listen_sock. We use a tricky non-blocking, non-forking, non-threaded model which allows us to handle many simultaneous connections while remaining impervious to many denial of @@ -954,18 +975,8 @@ static void process_loop(void) /* Check signal handling things */ - if (do_sigterm) - terminate(); - - if (do_sighup) { - - DEBUG(3, ("got SIGHUP\n")); - - flush_caches(); - reload_services_file(); - - do_sighup = False; - } + winbind_check_sigterm(); + winbind_check_sighup(); if (do_sigusr2) { print_winbindd_status(); diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index f71eec56f6a..1d741be79ea 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -1105,6 +1105,10 @@ static bool fork_domain_child(struct winbindd_child *child) struct timeval now; TALLOC_CTX *frame = talloc_stackframe(); + /* check for signals */ + winbind_check_sigterm(); + winbind_check_sighup(); + run_events(winbind_event_context(), 0, NULL, NULL); GetTimeOfDay(&now);