Skip to content

Commit 3467214

Browse files
cryptomilkabartlet
authored andcommitted
s3: Remove --log-stdout from daemons
The common cmdline parser provides --debug-stdout. Signed-off-by: Andreas Schneider <[email protected]> Reviewed-by: Andrew Bartlett <[email protected]>
1 parent c7b1d2d commit 3467214

File tree

9 files changed

+19
-78
lines changed

9 files changed

+19
-78
lines changed

docs-xml/manpages/nmbd.8.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<command>nmbd</command>
2323
<arg choice="opt">-D|--daemon</arg>
2424
<arg choice="opt">-F|--foreground</arg>
25-
<arg choice="opt">-S|--log-stdout</arg>
2625
<arg choice="opt">-i|--interactive</arg>
2726
<arg choice="opt">-V</arg>
2827
<arg choice="opt">-d &lt;debug level&gt;</arg>
@@ -105,13 +104,6 @@
105104
</para></listitem>
106105
</varlistentry>
107106

108-
<varlistentry>
109-
<term>-S|--log-stdout</term>
110-
<listitem><para>If specified, this parameter causes
111-
<command>nmbd</command> to log to standard output rather
112-
than a file.</para></listitem>
113-
</varlistentry>
114-
115107
<varlistentry>
116108
<term>-i|--interactive</term>
117109
<listitem><para>If this parameter is specified it causes the

docs-xml/manpages/smbd.8.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<command>smbd</command>
2222
<arg choice="opt">-D|--daemon</arg>
2323
<arg choice="opt">-F|--foreground</arg>
24-
<arg choice="opt">-S|--log-stdout</arg>
2524
<arg choice="opt">-i|--interactive</arg>
2625
<arg choice="opt">-V</arg>
2726
<arg choice="opt">-b|--build-options</arg>
@@ -114,13 +113,6 @@
114113
</para></listitem>
115114
</varlistentry>
116115

117-
<varlistentry>
118-
<term>-S|--log-stdout</term>
119-
<listitem><para>If specified, this parameter causes
120-
<command>smbd</command> to log to standard output rather
121-
than a file.</para></listitem>
122-
</varlistentry>
123-
124116
<varlistentry>
125117
<term>-i|--interactive</term>
126118
<listitem><para>If this parameter is specified it causes the

docs-xml/manpages/winbindd.8.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<command>winbindd</command>
2323
<arg choice="opt">-D|--daemon</arg>
2424
<arg choice="opt">-F|--foreground</arg>
25-
<arg choice="opt">-S|--stdout</arg>
2625
<arg choice="opt">-i|--interactive</arg>
2726
<arg choice="opt">-d &lt;debug level&gt;</arg>
2827
<arg choice="opt">-s &lt;smb config file&gt;</arg>
@@ -160,13 +159,6 @@ hosts: files wins
160159
</para></listitem>
161160
</varlistentry>
162161

163-
<varlistentry>
164-
<term>-S|--stdout</term>
165-
<listitem><para>If specified, this parameter causes
166-
<command>winbindd</command> to log to standard output rather
167-
than a file.</para></listitem>
168-
</varlistentry>
169-
170162
&stdarg.server.debug;
171163
&popt.common.samba;
172164
&popt.autohelp;

file_server/file_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static NTSTATUS s3fs_task_init(struct task_server *task)
8686
"--option=server role check:inhibit=yes",
8787
"--foreground",
8888
config_file,
89-
debug_get_output_is_stdout()?"--log-stdout":NULL,
89+
debug_get_output_is_stdout()?"--debug-stdout":NULL,
9090
NULL);
9191
/* the parent should not be able to call through nss_winbind */
9292
if (!winbind_off()) {

selftest/target/Samba3.pm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ sub make_bin_cmd
18471847
"-l", $env_vars->{LOGDIR});
18481848

18491849
if (not defined($dont_log_stdout)) {
1850-
push(@args, "--log-stdout");
1850+
push(@args, "--debug-stdout");
18511851
}
18521852
return (@preargs, $binary, @args, @optargs);
18531853
}
@@ -1895,11 +1895,9 @@ sub check_or_start($$) {
18951895

18961896
$binary = Samba::bindir_path($self, "winbindd");
18971897
@full_cmd = $self->make_bin_cmd($binary, $env_vars,
1898-
$ENV{WINBINDD_OPTIONS}, $ENV{WINBINDD_VALGRIND}, "N/A");
1899-
1900-
if (not defined($ENV{WINBINDD_DONT_LOG_STDOUT})) {
1901-
push(@full_cmd, "--stdout");
1902-
}
1898+
$ENV{WINBINDD_OPTIONS},
1899+
$ENV{WINBINDD_VALGRIND},
1900+
$ENV{WINBINDD_DONT_LOG_STDOUT});
19031901

19041902
# fork and exec() winbindd in the child process
19051903
$daemon_ctx = {

source3/nmbd/nmbd.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,7 @@ static bool open_sockets(bool isdaemon, int port)
784784
OPT_DAEMON = 1000,
785785
OPT_INTERACTIVE,
786786
OPT_FORK,
787-
OPT_NO_PROCESS_GROUP,
788-
OPT_LOG_STDOUT
787+
OPT_NO_PROCESS_GROUP
789788
};
790789
struct poptOption long_options[] = {
791790
POPT_AUTOHELP
@@ -822,14 +821,6 @@ static bool open_sockets(bool isdaemon, int port)
822821
.val = OPT_NO_PROCESS_GROUP,
823822
.descrip = "Don't create a new process group",
824823
},
825-
{
826-
.longName = "log-stdout",
827-
.shortName = 'S',
828-
.argInfo = POPT_ARG_NONE,
829-
.arg = NULL,
830-
.val = OPT_LOG_STDOUT,
831-
.descrip = "Log to stdout",
832-
},
833824
{
834825
.longName = "hosts",
835826
.shortName = 'H',
@@ -906,9 +897,6 @@ static bool open_sockets(bool isdaemon, int port)
906897
case OPT_NO_PROCESS_GROUP:
907898
no_process_group = true;
908899
break;
909-
case OPT_LOG_STDOUT:
910-
log_stdout = true;
911-
break;
912900
default:
913901
d_fprintf(stderr, "\nInvalid option %s: %s\n\n",
914902
poptBadOption(pc, 0), poptStrerror(opt));
@@ -954,6 +942,7 @@ static bool open_sockets(bool isdaemon, int port)
954942
/* Ignore children - no zombies. */
955943
CatchChild();
956944

945+
log_stdout = (debug_get_log_type() == DEBUG_STDOUT);
957946
if ( opt_interactive ) {
958947
Fork = False;
959948
log_stdout = True;
@@ -964,9 +953,7 @@ static bool open_sockets(bool isdaemon, int port)
964953
exit(1);
965954
}
966955

967-
if (log_stdout) {
968-
setup_logging(argv[0], DEBUG_STDOUT);
969-
} else {
956+
if (!log_stdout) {
970957
setup_logging( argv[0], DEBUG_FILE);
971958
}
972959

source3/smbd/server.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,6 @@ extern void build_options(bool screen);
15551555
OPT_INTERACTIVE,
15561556
OPT_FORK,
15571557
OPT_NO_PROCESS_GROUP,
1558-
OPT_LOG_STDOUT
15591558
};
15601559
struct poptOption long_options[] = {
15611560
POPT_AUTOHELP
@@ -1591,14 +1590,6 @@ extern void build_options(bool screen);
15911590
.val = OPT_NO_PROCESS_GROUP,
15921591
.descrip = "Don't create a new process group" ,
15931592
},
1594-
{
1595-
.longName = "log-stdout",
1596-
.shortName = 'S',
1597-
.argInfo = POPT_ARG_NONE,
1598-
.arg = NULL,
1599-
.val = OPT_LOG_STDOUT,
1600-
.descrip = "Log to stdout" ,
1601-
},
16021593
{
16031594
.longName = "build-options",
16041595
.shortName = 'b',
@@ -1707,9 +1698,6 @@ extern void build_options(bool screen);
17071698
case OPT_NO_PROCESS_GROUP:
17081699
no_process_group = true;
17091700
break;
1710-
case OPT_LOG_STDOUT:
1711-
log_stdout = true;
1712-
break;
17131701
case 'b':
17141702
print_build_options = True;
17151703
break;
@@ -1722,14 +1710,14 @@ extern void build_options(bool screen);
17221710
}
17231711
poptFreeContext(pc);
17241712

1713+
log_stdout = (debug_get_log_type() == DEBUG_STDOUT);
1714+
17251715
if (interactive) {
17261716
Fork = False;
17271717
log_stdout = True;
17281718
}
17291719

1730-
if (log_stdout) {
1731-
setup_logging(argv[0], DEBUG_STDOUT);
1732-
} else {
1720+
if (!log_stdout) {
17331721
setup_logging(argv[0], DEBUG_FILE);
17341722
}
17351723

source3/winbindd/winbindd.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,19 +1589,10 @@ int main(int argc, const char **argv)
15891589
enum {
15901590
OPT_DAEMON = 1000,
15911591
OPT_FORK,
1592-
OPT_NO_PROCESS_GROUP,
1593-
OPT_LOG_STDOUT
1592+
OPT_NO_PROCESS_GROUP
15941593
};
15951594
struct poptOption long_options[] = {
15961595
POPT_AUTOHELP
1597-
{
1598-
.longName = "stdout",
1599-
.shortName = 'S',
1600-
.argInfo = POPT_ARG_NONE,
1601-
.arg = NULL,
1602-
.val = OPT_LOG_STDOUT,
1603-
.descrip = "Log to stdout",
1604-
},
16051596
{
16061597
.longName = "foreground",
16071598
.shortName = 'F',
@@ -1702,18 +1693,13 @@ int main(int argc, const char **argv)
17021693
break;
17031694
case 'i':
17041695
interactive = True;
1705-
log_stdout = True;
1706-
Fork = False;
17071696
break;
17081697
case OPT_FORK:
17091698
Fork = false;
17101699
break;
17111700
case OPT_NO_PROCESS_GROUP:
17121701
no_process_group = true;
17131702
break;
1714-
case OPT_LOG_STDOUT:
1715-
log_stdout = true;
1716-
break;
17171703
case 'n':
17181704
opt_nocache = true;
17191705
break;
@@ -1745,6 +1731,12 @@ int main(int argc, const char **argv)
17451731
exit(1);
17461732
}
17471733

1734+
log_stdout = (debug_get_log_type() == DEBUG_STDOUT);
1735+
if (interactive) {
1736+
Fork = true;
1737+
log_stdout = true;
1738+
}
1739+
17481740
if (log_stdout && Fork) {
17491741
d_fprintf(stderr, "\nERROR: "
17501742
"Can't log to stdout (-S) unless daemon is in foreground +(-F) or interactive (-i)\n\n");

source4/winbind/winbindd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static NTSTATUS winbindd_task_init(struct task_server *task)
8585
"--option=server role check:inhibit=yes",
8686
"--foreground",
8787
config_file,
88-
debug_get_output_is_stdout()?"--stdout":NULL,
88+
debug_get_output_is_stdout()?"--debug-stdout":NULL,
8989
NULL);
9090
if (subreq == NULL) {
9191
DEBUG(0, ("Failed to start winbindd as child daemon\n"));

0 commit comments

Comments
 (0)