Bug 6212 - Parameter -l (log-basename) has no effect
Parameter -l (log-basename) has no effect
Product: Samba 4.0
Classification: Unclassified
Component: File services
Other Linux
: P3 normal
: ---
Assigned To: Andrew Bartlett
Depends on:
  Show dependency treegraph
Reported: 2009-03-25 05:10 UTC by Matthieu Patou
Modified: 2010-02-13 12:46 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Patou 2009-03-25 05:10:33 UTC
Starting the samba4 daemon with -l do not influence the place where logs are stored.

I turns out that the variable logfile is filled with the parameter value when the command line is parsed but after calling lp_file_list_changed in source4/param/loadparm.c, the value is lost.
Comment 1 Matthieu Patou 2009-04-18 05:40:54 UTC
Any news on this ?
Comment 2 Matthias Dieter Wallnöfer 2009-07-31 12:01:41 UTC
Matthieu, I tried to trace the problem in the source code, but didn't come further.
If it's possible for you, please investigate this a bit further and provide more detailed code locations (file/line numbers).
Also a patch would be welcome if you manage to write one.
Comment 3 Matthias Dieter Wallnöfer 2010-02-13 11:58:22 UTC
The behaviour is as follows:
The log output is always STDOUT until the basic settings were read in. Then, in server.c before the message "samba 4 version X started" the function setup_logging (always function "binary_smbd_main") is called. If you run "samba" in the interactive mode, it remains STDOUT. But if you run it as a daemon, the log is written in a predefined place (in my case /usr/local/samba/var/samba.log").

The problem left to fix is the ignored "-l" parameter. I'm looking into this.
Comment 4 Matthias Dieter Wallnöfer 2010-02-13 12:46:26 UTC
Bug fixed. Now s4 creates a file "log.samba" under the directory you specified with "-l". If the parameter isn't specified at all the default log location will be "var/samba.log". And all the logging through files works only in the daemon mode, never in the interactive one as stated in the previous comment.