summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/nmbd/nmbd.c19
-rw-r--r--source3/smbd/server.c18
-rw-r--r--source3/winbindd/winbindd.c22
3 files changed, 13 insertions, 46 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 2311ad8dde3..05645967e05 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -784,8 +784,7 @@ static bool open_sockets(bool isdaemon, int port)
OPT_DAEMON = 1000,
OPT_INTERACTIVE,
OPT_FORK,
- OPT_NO_PROCESS_GROUP,
- OPT_LOG_STDOUT
+ OPT_NO_PROCESS_GROUP
};
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -823,14 +822,6 @@ static bool open_sockets(bool isdaemon, int port)
.descrip = "Don't create a new process group",
},
{
- .longName = "log-stdout",
- .shortName = 'S',
- .argInfo = POPT_ARG_NONE,
- .arg = NULL,
- .val = OPT_LOG_STDOUT,
- .descrip = "Log to stdout",
- },
- {
.longName = "hosts",
.shortName = 'H',
.argInfo = POPT_ARG_STRING,
@@ -906,9 +897,6 @@ static bool open_sockets(bool isdaemon, int port)
case OPT_NO_PROCESS_GROUP:
no_process_group = true;
break;
- case OPT_LOG_STDOUT:
- log_stdout = true;
- break;
default:
d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
poptBadOption(pc, 0), poptStrerror(opt));
@@ -954,6 +942,7 @@ static bool open_sockets(bool isdaemon, int port)
/* Ignore children - no zombies. */
CatchChild();
+ log_stdout = (debug_get_log_type() == DEBUG_STDOUT);
if ( opt_interactive ) {
Fork = False;
log_stdout = True;
@@ -964,9 +953,7 @@ static bool open_sockets(bool isdaemon, int port)
exit(1);
}
- if (log_stdout) {
- setup_logging(argv[0], DEBUG_STDOUT);
- } else {
+ if (!log_stdout) {
setup_logging( argv[0], DEBUG_FILE);
}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index bb7820399cd..e40cc27d2b8 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1555,7 +1555,6 @@ extern void build_options(bool screen);
OPT_INTERACTIVE,
OPT_FORK,
OPT_NO_PROCESS_GROUP,
- OPT_LOG_STDOUT
};
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -1592,14 +1591,6 @@ extern void build_options(bool screen);
.descrip = "Don't create a new process group" ,
},
{
- .longName = "log-stdout",
- .shortName = 'S',
- .argInfo = POPT_ARG_NONE,
- .arg = NULL,
- .val = OPT_LOG_STDOUT,
- .descrip = "Log to stdout" ,
- },
- {
.longName = "build-options",
.shortName = 'b',
.argInfo = POPT_ARG_NONE,
@@ -1707,9 +1698,6 @@ extern void build_options(bool screen);
case OPT_NO_PROCESS_GROUP:
no_process_group = true;
break;
- case OPT_LOG_STDOUT:
- log_stdout = true;
- break;
case 'b':
print_build_options = True;
break;
@@ -1722,14 +1710,14 @@ extern void build_options(bool screen);
}
poptFreeContext(pc);
+ log_stdout = (debug_get_log_type() == DEBUG_STDOUT);
+
if (interactive) {
Fork = False;
log_stdout = True;
}
- if (log_stdout) {
- setup_logging(argv[0], DEBUG_STDOUT);
- } else {
+ if (!log_stdout) {
setup_logging(argv[0], DEBUG_FILE);
}
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 3b0fecf08a0..02da60cb9fa 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -1589,20 +1589,11 @@ int main(int argc, const char **argv)
enum {
OPT_DAEMON = 1000,
OPT_FORK,
- OPT_NO_PROCESS_GROUP,
- OPT_LOG_STDOUT
+ OPT_NO_PROCESS_GROUP
};
struct poptOption long_options[] = {
POPT_AUTOHELP
{
- .longName = "stdout",
- .shortName = 'S',
- .argInfo = POPT_ARG_NONE,
- .arg = NULL,
- .val = OPT_LOG_STDOUT,
- .descrip = "Log to stdout",
- },
- {
.longName = "foreground",
.shortName = 'F',
.argInfo = POPT_ARG_NONE,
@@ -1702,8 +1693,6 @@ int main(int argc, const char **argv)
break;
case 'i':
interactive = True;
- log_stdout = True;
- Fork = False;
break;
case OPT_FORK:
Fork = false;
@@ -1711,9 +1700,6 @@ int main(int argc, const char **argv)
case OPT_NO_PROCESS_GROUP:
no_process_group = true;
break;
- case OPT_LOG_STDOUT:
- log_stdout = true;
- break;
case 'n':
opt_nocache = true;
break;
@@ -1745,6 +1731,12 @@ int main(int argc, const char **argv)
exit(1);
}
+ log_stdout = (debug_get_log_type() == DEBUG_STDOUT);
+ if (interactive) {
+ Fork = true;
+ log_stdout = true;
+ }
+
if (log_stdout && Fork) {
d_fprintf(stderr, "\nERROR: "
"Can't log to stdout (-S) unless daemon is in foreground +(-F) or interactive (-i)\n\n");