summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2021-01-11 09:52:36 +0100
committerAndrew Bartlett <abartlet@samba.org>2021-04-29 03:58:37 +0000
commit3467214cf967641f4e4001a9dfea870f933fc2a3 (patch)
tree218d8b03a2a3f1afb1a610b4ecff4c712371ae51
parentc7b1d2d11cfc348e654375fc1e880bf4e1773b88 (diff)
downloadsamba-3467214cf967641f4e4001a9dfea870f933fc2a3.tar.gz
s3: Remove --log-stdout from daemons
The common cmdline parser provides --debug-stdout. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--docs-xml/manpages/nmbd.8.xml8
-rw-r--r--docs-xml/manpages/smbd.8.xml8
-rw-r--r--docs-xml/manpages/winbindd.8.xml8
-rw-r--r--file_server/file_server.c2
-rwxr-xr-xselftest/target/Samba3.pm10
-rw-r--r--source3/nmbd/nmbd.c19
-rw-r--r--source3/smbd/server.c18
-rw-r--r--source3/winbindd/winbindd.c22
-rw-r--r--source4/winbind/winbindd.c2
9 files changed, 19 insertions, 78 deletions
diff --git a/docs-xml/manpages/nmbd.8.xml b/docs-xml/manpages/nmbd.8.xml
index 4ece42f3ca6..2eea65bfe6a 100644
--- a/docs-xml/manpages/nmbd.8.xml
+++ b/docs-xml/manpages/nmbd.8.xml
@@ -22,7 +22,6 @@
<command>nmbd</command>
<arg choice="opt">-D|--daemon</arg>
<arg choice="opt">-F|--foreground</arg>
- <arg choice="opt">-S|--log-stdout</arg>
<arg choice="opt">-i|--interactive</arg>
<arg choice="opt">-V</arg>
<arg choice="opt">-d &lt;debug level&gt;</arg>
@@ -106,13 +105,6 @@
</varlistentry>
<varlistentry>
- <term>-S|--log-stdout</term>
- <listitem><para>If specified, this parameter causes
- <command>nmbd</command> to log to standard output rather
- than a file.</para></listitem>
- </varlistentry>
-
- <varlistentry>
<term>-i|--interactive</term>
<listitem><para>If this parameter is specified it causes the
server to run "interactively", not as a daemon, even if the
diff --git a/docs-xml/manpages/smbd.8.xml b/docs-xml/manpages/smbd.8.xml
index 73d808c70b7..5d22bfc599f 100644
--- a/docs-xml/manpages/smbd.8.xml
+++ b/docs-xml/manpages/smbd.8.xml
@@ -21,7 +21,6 @@
<command>smbd</command>
<arg choice="opt">-D|--daemon</arg>
<arg choice="opt">-F|--foreground</arg>
- <arg choice="opt">-S|--log-stdout</arg>
<arg choice="opt">-i|--interactive</arg>
<arg choice="opt">-V</arg>
<arg choice="opt">-b|--build-options</arg>
@@ -115,13 +114,6 @@
</varlistentry>
<varlistentry>
- <term>-S|--log-stdout</term>
- <listitem><para>If specified, this parameter causes
- <command>smbd</command> to log to standard output rather
- than a file.</para></listitem>
- </varlistentry>
-
- <varlistentry>
<term>-i|--interactive</term>
<listitem><para>If this parameter is specified it causes the
server to run "interactively", not as a daemon, even if the
diff --git a/docs-xml/manpages/winbindd.8.xml b/docs-xml/manpages/winbindd.8.xml
index d5acc072a00..2c457a46d90 100644
--- a/docs-xml/manpages/winbindd.8.xml
+++ b/docs-xml/manpages/winbindd.8.xml
@@ -22,7 +22,6 @@
<command>winbindd</command>
<arg choice="opt">-D|--daemon</arg>
<arg choice="opt">-F|--foreground</arg>
- <arg choice="opt">-S|--stdout</arg>
<arg choice="opt">-i|--interactive</arg>
<arg choice="opt">-d &lt;debug level&gt;</arg>
<arg choice="opt">-s &lt;smb config file&gt;</arg>
@@ -160,13 +159,6 @@ hosts: files wins
</para></listitem>
</varlistentry>
- <varlistentry>
- <term>-S|--stdout</term>
- <listitem><para>If specified, this parameter causes
- <command>winbindd</command> to log to standard output rather
- than a file.</para></listitem>
- </varlistentry>
-
&stdarg.server.debug;
&popt.common.samba;
&popt.autohelp;
diff --git a/file_server/file_server.c b/file_server/file_server.c
index b55f13f5687..b8e53cd675c 100644
--- a/file_server/file_server.c
+++ b/file_server/file_server.c
@@ -86,7 +86,7 @@ static NTSTATUS s3fs_task_init(struct task_server *task)
"--option=server role check:inhibit=yes",
"--foreground",
config_file,
- debug_get_output_is_stdout()?"--log-stdout":NULL,
+ debug_get_output_is_stdout()?"--debug-stdout":NULL,
NULL);
/* the parent should not be able to call through nss_winbind */
if (!winbind_off()) {
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 40efa36fdf3..410b0458a4d 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1847,7 +1847,7 @@ sub make_bin_cmd
"-l", $env_vars->{LOGDIR});
if (not defined($dont_log_stdout)) {
- push(@args, "--log-stdout");
+ push(@args, "--debug-stdout");
}
return (@preargs, $binary, @args, @optargs);
}
@@ -1895,11 +1895,9 @@ sub check_or_start($$) {
$binary = Samba::bindir_path($self, "winbindd");
@full_cmd = $self->make_bin_cmd($binary, $env_vars,
- $ENV{WINBINDD_OPTIONS}, $ENV{WINBINDD_VALGRIND}, "N/A");
-
- if (not defined($ENV{WINBINDD_DONT_LOG_STDOUT})) {
- push(@full_cmd, "--stdout");
- }
+ $ENV{WINBINDD_OPTIONS},
+ $ENV{WINBINDD_VALGRIND},
+ $ENV{WINBINDD_DONT_LOG_STDOUT});
# fork and exec() winbindd in the child process
$daemon_ctx = {
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");
diff --git a/source4/winbind/winbindd.c b/source4/winbind/winbindd.c
index 5a74db66159..7b6e3d92333 100644
--- a/source4/winbind/winbindd.c
+++ b/source4/winbind/winbindd.c
@@ -85,7 +85,7 @@ static NTSTATUS winbindd_task_init(struct task_server *task)
"--option=server role check:inhibit=yes",
"--foreground",
config_file,
- debug_get_output_is_stdout()?"--stdout":NULL,
+ debug_get_output_is_stdout()?"--debug-stdout":NULL,
NULL);
if (subreq == NULL) {
DEBUG(0, ("Failed to start winbindd as child daemon\n"));