summaryrefslogtreecommitdiffstats
path: root/source3/nmbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-08 04:41:51 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-08 04:41:51 +0000
commitbfbca5ac7706d03056366b84b679faeab904ecae (patch)
tree76245c69b26accaa49216a8b7e343888d48b6d05 /source3/nmbd
parentb1228b7dcf5257534109fdaefb40c67645bc2a4a (diff)
downloadsamba-bfbca5ac7706d03056366b84b679faeab904ecae.tar.gz
samba-bfbca5ac7706d03056366b84b679faeab904ecae.tar.xz
samba-bfbca5ac7706d03056366b84b679faeab904ecae.zip
changes from Luke
(This used to be commit 5269aa277c635cfda65a27fd1b2e587ac181e1c3)
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index cd2ebb0521..8ab9f528ef 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -55,6 +55,28 @@ time_t StartupTime =0;
extern struct in_addr ipzero;
+ /****************************************************************************
+catch a sigterm
+****************************************************************************/
+static int sig_term()
+{
+ BlockSignals(True);
+
+ DEBUG(0,("Got SIGTERM: going down...\n"));
+
+ dump_names();
+ reload_services(True);
+
+ /* remove all samba names, with wins server if necessary. */
+ remove_my_names();
+
+ /* XXXX don't care if we never receive a response back... yet */
+ /* XXXX other things: if we are a master browser, force an election? */
+
+ exit(0);
+}
+
+
/****************************************************************************
catch a sighup
****************************************************************************/
@@ -267,7 +289,7 @@ static void load_hosts_file(char *fname)
if (group) {
add_domain_entry(ipaddr, ipmask, name, True);
} else {
- add_netbios_entry(name,0x20,NB_ACTIVE,0,source,ipaddr,False);
+ add_netbios_entry(name,0x20,NB_ACTIVE,0,source,ipaddr);
}
}
}
@@ -426,8 +448,9 @@ static void usage(char *pname)
fault_setup(fault_continue);
signal(SIGHUP,SIGNAL_CAST sig_hup);
+ signal(SIGTERM,SIGNAL_CAST sig_term);
- while ((opt = getopt (argc, argv, "s:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:")) != EOF)
+ while ((opt = getopt(argc, argv, "s:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:")) != EOF)
{
switch (opt)
{