2.2.1a and 2.2.2 smbd/nmbd handle -l differently
samba-technical at thewrittenword.com
samba-technical at thewrittenword.com
Tue Oct 16 19:15:03 GMT 2001
On Tue, Oct 16, 2001 at 09:06:02PM -0500, samba-technical at thewrittenword.com wrote:
> According to smbd(8) for 2.2.1a:
> -l <log file>
> If specified, log file specifies a log filename into
> which informational and debug messages from the running
> server will be logged. The log file generated is never
> removed by the server although its size may be con-
> trolled by the max log size option in the
> smb.conf(5)file. The default log file name is specified
> at compile time.
>
> and, smbd(8) for 2.2.2:
> -l <log file>
> If specified, log file specifies a log filename into
> which informational and debug messages from the running
> server will be logged. The log file generated is never
> removed by the server although its size may be con-
> trolled by the max log size option in the
> smb.conf(5)file. The default log file name is specified
> at compile time.
>
> This leads me to believe that:
> $ smbd -l /tmp/foo
> will write to the log file "/tmp/foo". For 2.2.1a, this works. For
> 2.2.2, no log file is written. Yet, if I:
> $ mkdir /tmp/foo
> $ smbd -l /tmp/foo
> then the log file is "/tmp/foo/log.smbd".
>
> Should -l in 2.2.2 behave like in 2.2.1a? I didn't see a note of the
> change in WHATSNEW.txt.
>
> Ditto for nmbd.
Ok, here's the culprit:
(source/smbd/server.c)
revision 1.331
date: 2001/07/17 20:42:59; author: jra; state: Exp; lines: +1 -1
Fixes from Jens-Uwe.Walther at force.de to make the -l option behave
consistently.
Jeremy.
$ cvs diff -r1.331 -r1.330 server.c
--- server.c 17 Jul 2001 20:42:59 -0000 1.331
+++ server.c 10 Jul 2001 02:28:17 -0000 1.330
@@ -574,7 +574,7 @@ static void usage(char *pname)
case 'l':
specified_logfile = True;
- slprintf(debugf, sizeof(debugf)-1, "%s/log.smbd", optarg);
+ pstrcpy(debugf,optarg);
break;
case 'a':
(source/nmbd/nmbd.c)
revision 1.116
date: 2001/07/17 20:42:59; author: jra; state: Exp; lines: +1 -1
Fixes from Jens-Uwe.Walther at force.de to make the -l option behave
consistently.
Jeremy.
$ cvs diff -r1.116 -r1.115 nmbd.c
--- nmbd.c 17 Jul 2001 20:42:59 -0000 1.116
+++ nmbd.c 4 Jul 2001 07:36:00 -0000 1.115
@@ -737,7 +737,7 @@ static void usage(char *pname)
strupper(global_myname);
break;
case 'l':
- slprintf(debugf, sizeof(debugf)-1, "%s/log.nmbd", optarg);
+ slprintf(debugf,sizeof(debugf)-1, "%s.nmb",optarg);
break;
case 'a':
append_log = True;
How's the following patch? I don't have docbook so can't autogenerate
the man pages from this.
--
albert chin (china at thewrittenword.com)
-- snip snip
Index: docs/docbook/manpages/nmbd.8.sgml
===================================================================
RCS file: /cvsroot/samba/docs/docbook/manpages/nmbd.8.sgml,v
retrieving revision 1.2.2.5
diff -u -3 -p -r1.2.2.5 nmbd.8.sgml
--- docs/docbook/manpages/nmbd.8.sgml 26 Sep 2001 15:25:27 -0000 1.2.2.5
+++ docs/docbook/manpages/nmbd.8.sgml 17 Oct 2001 02:13:48 -0000
@@ -24,7 +24,7 @@
<arg choice="opt">-V</arg>
<arg choice="opt">-d <debug level></arg>
<arg choice="opt">-H <lmhosts file></arg>
- <arg choice="opt">-l <log file></arg>
+ <arg choice="opt">-l <log directory></arg>
<arg choice="opt">-n <primary netbios name></arg>
<arg choice="opt">-p <port number></arg>
<arg choice="opt">-s <configuration file></arg>
@@ -162,17 +162,14 @@
</varlistentry>
<varlistentry>
- <term>-l <log file></term>
- <listitem><para>The -l parameter specifies a path
- and base filename into which operational data from
- the running <command>nmbd</command> server will
- be logged. The actual log file name is generated by
- appending the extension ".nmb" to the specified base
- name. For example, if the name specified was "log"
- then the file log.nmb would contain the debugging data.</para>
+ <term>-l <log directory></term>
+ <listitem><para>The -l parameter specifies a directory
+ into which the "log.nmbd" log file will be created
+ for operational data from the running
+ <command>nmbd</command> server.</para>
- <para>The default log file path is compiled into Samba as
- part of the build process. Common defaults are <filename>
+ <para>The default log directory is compiled into Samba
+ as part of the build process. Common defaults are <filename>
/usr/local/samba/var/log.nmb</filename>, <filename>
/usr/samba/var/log.nmb</filename> or
<filename>/var/log/log.nmb</filename>.</para></listitem>
Index: docs/docbook/manpages/smbd.8.sgml
===================================================================
RCS file: /cvsroot/samba/docs/docbook/manpages/smbd.8.sgml,v
retrieving revision 1.2.2.5
diff -u -3 -p -r1.2.2.5 smbd.8.sgml
--- docs/docbook/manpages/smbd.8.sgml 31 Jul 2001 21:01:22 -0000 1.2.2.5
+++ docs/docbook/manpages/smbd.8.sgml 17 Oct 2001 02:13:52 -0000
@@ -22,7 +22,7 @@
<arg choice="opt">-h</arg>
<arg choice="opt">-V</arg>
<arg choice="opt">-d <debug level></arg>
- <arg choice="opt">-l <log file></arg>
+ <arg choice="opt">-l <log directory></arg>
<arg choice="opt">-p <port number></arg>
<arg choice="opt">-O <socket option></arg>
<arg choice="opt">-s <configuration file></arg>
@@ -148,16 +148,20 @@
</varlistentry>
<varlistentry>
- <term>-l <log file></term>
- <listitem><para>If specified, <replaceable>log file</replaceable>
- specifies a log filename into which informational and debug
- messages from the running server will be logged. The log
+ <term>-l <log directory></term>
+ <listitem><para>If specified,
+ <replaceable>log directory</replaceable>
+ specifies a log directory into which the "log.smbd" log
+ file will be created for informational and debug
+ messages from the running server. The log
file generated is never removed by the server although
its size may be controlled by the <ulink
url="smb.conf.5.html#maxlogsize">max log size</ulink>
option in the <ulink url="smb.conf.5.html"><filename>
- smb.conf(5)</filename></ulink> file. The default log
- file name is specified at compile time.</para></listitem>
+ smb.conf(5)</filename></ulink> file.
+
+ <para>The default log directory is specified at
+ compile time.</para></listitem>
</varlistentry>
<varlistentry>
More information about the samba-technical
mailing list