summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-12-29 21:13:53 +0000
committerJeremy Allison <jra@samba.org>2001-12-29 21:13:53 +0000
commit9343b613d3778b0330bc4d610d3befd363797360 (patch)
treefc5e0c72a746e9b5bfce3d1bb82a9a8cc0c4e9a7
parent7ce2d1fe37d2be26c407f3dc9427851d00ca216a (diff)
downloadsamba-9343b613d3778b0330bc4d610d3befd363797360.tar.gz
samba-9343b613d3778b0330bc4d610d3befd363797360.tar.xz
samba-9343b613d3778b0330bc4d610d3befd363797360.zip
Fixup -i interactive modes.
Jeremy.
-rw-r--r--source/nmbd/nmbd.c11
-rw-r--r--source/smbd/server.c18
2 files changed, 18 insertions, 11 deletions
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index 80d712036da..29b6c0347a2 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -634,10 +634,11 @@ static BOOL init_structs(void)
static void usage(char *pname)
{
- printf( "Usage: %s [-DaohV] [-H lmhosts file] [-d debuglevel] [-l log basename]\n", pname );
+ printf( "Usage: %s [-DaiohV] [-H lmhosts file] [-d debuglevel] [-l log basename]\n", pname );
printf( " [-n name] [-p port] [-s configuration file]\n" );
- printf( "\t-D Become a daemon\n" );
+ printf( "\t-D Become a daemon (default)\n" );
printf( "\t-a Append to log file (default)\n" );
+ printf( "\t-i Run interactive (not a daemon)\n" );
printf( "\t-o Overwrite log file, don't append\n" );
printf( "\t-h Print usage\n" );
printf( "\t-V Print version\n" );
@@ -717,9 +718,9 @@ static void usage(char *pname)
case 'G':
DEBUG(0,("Obsolete option '%c' used\n",opt));
break;
- case 'i':
- opt_interactive = True;
- break;
+ case 'i':
+ opt_interactive = True;
+ break;
case 'H':
pstrcpy(dyn_LMHOSTSFILE, optarg);
break;
diff --git a/source/smbd/server.c b/source/smbd/server.c
index c6eed4b9bb4..403ed12c408 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -559,10 +559,11 @@ usage on the program
static void usage(char *pname)
{
- d_printf("Usage: %s [-DaoPh?Vb] [-d debuglevel] [-l log basename] [-p port]\n", pname);
+ d_printf("Usage: %s [-DaioPh?Vb] [-d debuglevel] [-l log basename] [-p port]\n", pname);
d_printf(" [-O socket options] [-s services file]\n");
- d_printf("\t-D Become a daemon\n");
+ d_printf("\t-D Become a daemon (default)\n");
d_printf("\t-a Append to log file (default)\n");
+ d_printf("\t-i Run interactive (not a daemon)\n" );
d_printf("\t-o Overwrite log file, don't append\n");
d_printf("\t-h Print usage\n");
d_printf("\t-? Print usage\n");
@@ -585,6 +586,7 @@ static void usage(char *pname)
extern char *optarg;
/* shall I run as a daemon */
BOOL is_daemon = False;
+ BOOL interactive = False;
BOOL specified_logfile = False;
int port = SMB_PORT;
int opt;
@@ -600,7 +602,7 @@ static void usage(char *pname)
argc--;
}
- while ( EOF != (opt = getopt(argc, argv, "O:l:s:d:Dp:h?bVaof:")) )
+ while ( EOF != (opt = getopt(argc, argv, "O:l:s:d:Dp:h?bVaiof:")) )
switch (opt) {
case 'O':
pstrcpy(user_socket_options,optarg);
@@ -620,6 +622,10 @@ static void usage(char *pname)
append_log = True;
break;
+ case 'i':
+ interactive = True;
+ break;
+
case 'o':
append_log = False;
break;
@@ -678,7 +684,7 @@ static void usage(char *pname)
pstrcpy(remote_machine, "smbd");
- setup_logging(argv[0],False);
+ setup_logging(argv[0],interactive);
/* we want to re-seed early to prevent time delays causing
client problems at a later date. (tridge) */
@@ -720,7 +726,7 @@ static void usage(char *pname)
reopen_logs();
DEBUG(1,( "smbd version %s started.\n", VERSION));
- DEBUGADD(1,( "Copyright Andrew Tridgell 1992-1998\n"));
+ DEBUGADD(1,( "Copyright Andrew Tridgell 1992-2002\n"));
DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n",
(int)getuid(),(int)getgid(),(int)geteuid(),(int)getegid()));
@@ -774,7 +780,7 @@ static void usage(char *pname)
is_daemon = True;
}
- if (is_daemon) {
+ if (is_daemon && !interactive) {
DEBUG( 3, ( "Becoming a daemon.\n" ) );
become_daemon();
}