static void terminate(void)
{
DEBUG(0,("Got SIGTERM: going down...\n"));
-
+
/* Write out wins.dat file if samba is a WINS server */
wins_write_database(0,False);
-
+
/* Remove all SELF registered names from WINS */
release_wins_names();
-
+
/* Announce all server entries as 0 time-to-live, 0 type. */
announce_my_servers_removed();
static void expire_names_and_servers(time_t t)
{
static time_t lastrun = 0;
-
+
if ( !lastrun )
lastrun = t;
if ( t < (lastrun + 5) )
poptFreeContext(pc);
global_in_nmbd = true;
-
+
StartupTime = time(NULL);
-
+
sys_srandom(time(NULL) ^ sys_getpid());
-
+
if (!override_logfile) {
char *lfile = NULL;
if (asprintf(&lfile, "%s/log.nmbd", get_dyn_LOGFILEBASE()) < 0) {
lp_set_logfile(lfile);
SAFE_FREE(lfile);
}
-
+
fault_setup();
dump_core_setup("nmbd", lp_logfile());
-
+
/* POSIX demands that signals are inherited. If the invoking process has
* these signals masked, we will have problems, as we won't receive them. */
BlockSignals(False, SIGHUP);
DEBUG(0,("standard input is not a socket, assuming -D option\n"));
is_daemon = True;
}
-
+
if (is_daemon && !opt_interactive) {
DEBUG( 2, ( "Becoming a daemon.\n" ) );
become_daemon(Fork, no_process_group, log_stdout);