diff options
author | Jim McDonough <jmcd@samba.org> | 2008-05-13 16:29:53 -0400 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2008-05-13 16:29:53 -0400 |
commit | 8998e18a2f3c7a0095614e58992a2facb34a3bc3 (patch) | |
tree | aea4aa8b982c444c91610323fa1c336b5148c47d | |
parent | 660be616b85a32725841877041190a6ec0f122f1 (diff) | |
download | samba-8998e18a2f3c7a0095614e58992a2facb34a3bc3.tar.gz |
Enable winbind child processes to do something with signals,
in particular closing and reopening logs on SIGHUP.
-rw-r--r-- | source/nsswitch/winbindd.c | 31 | ||||
-rw-r--r-- | source/nsswitch/winbindd_dual.c | 4 |
2 files changed, 25 insertions, 10 deletions
diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c index 18abdab3489..636d63554e1 100644 --- a/source/nsswitch/winbindd.c +++ b/source/nsswitch/winbindd.c @@ -718,6 +718,25 @@ 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")); + + msg_reload_services(MSG_SMB_CONF_UPDATED, pid_to_procid(0), NULL, 0, NULL); + 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 @@ -882,16 +901,8 @@ static void process_loop(void) /* Check signal handling things */ - if (do_sigterm) - terminate(); - - if (do_sighup) { - - DEBUG(3, ("got SIGHUP\n")); - - msg_reload_services(MSG_SMB_CONF_UPDATED, pid_to_procid(0), NULL, 0, NULL); - do_sighup = False; - } + winbind_check_sigterm(); + winbind_check_sighup(); if (do_sigusr2) { print_winbindd_status(); diff --git a/source/nsswitch/winbindd_dual.c b/source/nsswitch/winbindd_dual.c index e0581100b1c..937924da391 100644 --- a/source/nsswitch/winbindd_dual.c +++ b/source/nsswitch/winbindd_dual.c @@ -1014,6 +1014,10 @@ static BOOL fork_domain_child(struct winbindd_child *child) lp_TALLOC_FREE(); main_loop_TALLOC_FREE(); + /* check for signals */ + winbind_check_sigterm(); + winbind_check_sighup(); + run_events(winbind_event_context(), 0, NULL, NULL); GetTimeOfDay(&now); |