diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-11-27 03:40:06 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-11-27 03:40:06 +0000 |
commit | a3e74d16d097d9a5393abfc7ae09a9c56d369bb6 (patch) | |
tree | d72893876df4275e615ffae8d6dc35642fe32d49 /source3/nmbd | |
parent | 6cf3434785ec369f6edbd5b1dd4dd1c26123b7c1 (diff) | |
download | samba-a3e74d16d097d9a5393abfc7ae09a9c56d369bb6.tar.gz samba-a3e74d16d097d9a5393abfc7ae09a9c56d369bb6.tar.bz2 samba-a3e74d16d097d9a5393abfc7ae09a9c56d369bb6.zip |
added -i option to nmbd, giving interactive mode (like winbindd)
(This used to be commit 1a30efdc2c7e5b385197bbfbcebac6a7305929b8)
Diffstat (limited to 'source3/nmbd')
-rw-r--r-- | source3/nmbd/nmbd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 1b6547f6c3..963e265330 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -661,6 +661,7 @@ static void usage(char *pname) int opt; extern char *optarg; extern BOOL append_log; + BOOL opt_interactive = False; append_log = True; /* Default, override with '-o' option. */ @@ -672,7 +673,6 @@ static void usage(char *pname) sys_srandom(time(NULL) ^ sys_getpid()); slprintf(debugf, sizeof(debugf)-1, "%s/log.nmbd", dyn_LOGFILEBASE); - setup_logging( argv[0], False ); /* this is for people who can't start the program correctly */ while (argc > 1 && (*argv[1] != '-')) @@ -703,7 +703,7 @@ static void usage(char *pname) #endif while( EOF != - (opt = getopt( argc, argv, "Vaos:T:I:C:bAB:N:Rn:l:d:Dp:hSH:G:f:" )) ) + (opt = getopt( argc, argv, "Vaos:T:I:C:bAB:N:Rn:l:d:Dp:hSH:G:f:i" )) ) { switch (opt) { @@ -717,6 +717,9 @@ static void usage(char *pname) case 'G': DEBUG(0,("Obsolete option '%c' used\n",opt)); break; + case 'i': + opt_interactive = True; + break; case 'H': pstrcpy(dyn_LMHOSTSFILE, optarg); break; @@ -761,6 +764,8 @@ static void usage(char *pname) } } + setup_logging( argv[0], opt_interactive ); + reopen_logs(); DEBUG( 1, ( "Netbios nameserver version %s started.\n", VERSION ) ); @@ -790,7 +795,7 @@ static void usage(char *pname) is_daemon = True; } - if (is_daemon) + if (is_daemon && !opt_interactive) { DEBUG( 2, ( "Becoming a daemon.\n" ) ); become_daemon(); |