summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2003-07-15 17:21:21 +0000
committerAlexander Bokovoy <ab@samba.org>2003-07-15 17:21:21 +0000
commit8c4be2bbc9d1b42ae1b26a3a2519dd2c911dee45 (patch)
tree8714ccf9f0658d5adf0adcfcb0cfeb771f843ef6 /source3/nsswitch
parentcf8628e5858f2875cfccbac87eb9b02ef5f7228d (diff)
downloadsamba-8c4be2bbc9d1b42ae1b26a3a2519dd2c911dee45.tar.gz
samba-8c4be2bbc9d1b42ae1b26a3a2519dd2c911dee45.tar.bz2
samba-8c4be2bbc9d1b42ae1b26a3a2519dd2c911dee45.zip
Add support for MSG_SMB_CONF_UPDATED and MSG_SHUTDOWN to all daemons (smbd, nmbd, winbindd). Reviewed by jerry and tridge.
(This used to be commit 02c5e2fc6f0721ebd82a9e6a2b34190607de55fe)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index ef55fe5123..0336312e89 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -66,6 +66,7 @@ static BOOL reload_services_file(BOOL test)
return(ret);
}
+
#if DUMP_CORE
/**************************************************************************** **
@@ -201,6 +202,20 @@ static void sighup_handler(int signum)
sys_select_signal();
}
+/* React on 'smbcontrol winbindd reload-config' in the same way as on SIGHUP*/
+static void msg_reload_services(int msg_type, pid_t src, void *buf, size_t len)
+{
+ /* Flush various caches */
+ flush_caches();
+ reload_services_file(True);
+}
+
+/* React on 'smbcontrol winbindd shutdown' in the same way as on SIGTERM*/
+static void msg_shutdown(int msg_type, pid_t src, void *buf, size_t len)
+{
+ terminate();
+}
+
struct dispatch_table {
enum winbindd_cmd cmd;
enum winbindd_result (*fn)(struct winbindd_cli_state *state);
@@ -746,11 +761,8 @@ static void process_loop(void)
if (do_sighup) {
DEBUG(3, ("got SIGHUP\n"));
-
- /* Flush various caches */
- flush_caches();
- reload_services_file(True);
+ msg_reload_services(MSG_SMB_CONF_UPDATED, (pid_t) 0, NULL, 0);
do_sighup = False;
}
@@ -919,6 +931,12 @@ int main(int argc, char **argv)
DEBUG(0, ("unable to initialise messaging system\n"));
exit(1);
}
+
+ /* React on 'smbcontrol winbindd reload-config' in the same way
+ as to SIGHUP signal */
+ message_register(MSG_SMB_CONF_UPDATED, msg_reload_services);
+ message_register(MSG_SHUTDOWN, msg_shutdown);
+
poptFreeContext(pc);
netsamlogon_cache_init(); /* Non-critical */