Hello, I run samba 3.6 and I need to track problems for dedicated users. So I thought, I load at the end via include special configurations for the user separately. My question is, how does the smbd configure itself. Does smbd 1) reads the config completely and then it set the parameters in the process or 2) does smbd reads and set each parameter instantly? So can I use the following example? Example: /etc/samba/smb.conf ======================================================[global] . . vfs objects = extd_audit debug uid = yes debug pid = yes debug class = yes log level = 0 vfs:2 syslog = 0 max log size = 1024 log file = /var/log/smbduserlogs/%U.log include = /etc/samba/debug/smb.conf.%U [share1] path = /data/users/%U writeable = yes browseable = no . . [share2] . . [share-n] . . include = /etc/samba/debug/smb.conf.priv.%U ====================================================== Example config for a dedicated user /etc/samba/debug/smb.conf.priv.smith ======================================================[global] vfs objects = extd_audit full_audit log level = 6 auth:10 passdb:10 vfs:3 max log size = 102400 [share1] path = /data/users/%U writeable = yes browseable = no . . full_audit:prefix = %u|%I|%m|%s full_audit:success = open read pwrite unlink mkdir rmdir rename full_audit:success = all full_audit:failure = all full_audit:facility = LOCAL7 full_audit:priority = ALERT ====================================================== Thanks for help!! Meike
From: Meike Stone <meike.stone at googlemail.com> Date: Fri, 17 Apr 2015 10:34:28 +0200> So I thought, I load at the end via include special configurations for > the user separately. > > My question is, how does the smbd configure itself. Does smbd > 1) reads the config completely and then it set the parameters in the process or > 2) does smbd reads and set each parameter instantly? > > So can I use the following example?Please see smb.conf(5) <https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html> "The file is included literally, as though typed in place. " So your example is wrong. At least you create 2 included smb.confs, one is inserted at the global section and the other is at "share1" section. --- TAKAHASHI Motonobu <monyo at monyo.com> / @damemonyo facebook.com/takahashi.motonobu
2015-04-19 13:00 GMT+02:00 TAKAHASHI Motonobu <monyo at monyo.com>:> From: Meike Stone <meike.stone at googlemail.com> > Date: Fri, 17 Apr 2015 10:34:28 +0200 > >> So I thought, I load at the end via include special configurations for >> the user separately. >> >> My question is, how does the smbd configure itself. Does smbd >> 1) reads the config completely and then it set the parameters in the process or >> 2) does smbd reads and set each parameter instantly? >> >> So can I use the following example? > > Please see smb.conf(5) > <https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html> > > "The file is included literally, as though typed in place. "That statement does say nothing, HOW the smbd reads/process the smb.conf and configure the internal variables. - INSTANTLY after reading each config value or - completely reading the config and set all internal variables AFTER this> So your example is wrong.I'm not sure if I'm really wrong! After several investigation, reading manual, howto and googling around, I found following statement: "Sections can be started multiple times, and parameters for one section accumulate over all mentions of that section. Parameters may specified multiple times for one section as well. The last mention of one parameter overrides earlier occurences." from Michael Adam. (https://www.samba.org/~obnox/presentations/linux-kongress-2008/lk2008-obnox.pdf) But I'm not sure, if it will set after reading the complete configuration file. All other would make no sense ... So can someone clarify this? Till now, I've nothing found about this in the (official) documentation. Thanks Meike
On 17/04/15 09:34, Meike Stone wrote:> Hello, > > I run samba 3.6 and I need to track problems for dedicated users. > So I thought, I load at the end via include special configurations for > the user separately. > > My question is, how does the smbd configure itself. Does smbd > 1) reads the config completely and then it set the parameters in the process or > 2) does smbd reads and set each parameter instantly? > > So can I use the following example? > > Example: > /etc/samba/smb.conf > ======================================================> [global] > . > . > > vfs objects = extd_audit > debug uid = yes > debug pid = yes > debug class = yes > log level = 0 vfs:2 > syslog = 0 > max log size = 1024 > log file = /var/log/smbduserlogs/%U.log > include = /etc/samba/debug/smb.conf.%U > > > [share1] > path = /data/users/%U > writeable = yes > browseable = no > . > . > > [share2] > . > . > > > [share-n] > . > . > > > include = /etc/samba/debug/smb.conf.priv.%U > ======================================================> > > > Example config for a dedicated user > /etc/samba/debug/smb.conf.priv.smith > ======================================================> [global] > > vfs objects = extd_audit full_audit > log level = 6 auth:10 passdb:10 vfs:3 > max log size = 102400 > > [share1] > path = /data/users/%U > writeable = yes > browseable = no > . > . > full_audit:prefix = %u|%I|%m|%s > full_audit:success = open read pwrite unlink mkdir rmdir rename > full_audit:success = all > full_audit:failure = all > full_audit:facility = LOCAL7 > full_audit:priority = ALERT > ======================================================> > > Thanks for help!! > > MeikeHi, have you considered the 'config file' option ? With this, you can created different smb.conf files and start the main smb.conf with: [global] config file = /etc/samba/debug/smb.conf.priv.%U .......... If the file exists it will be used when the user connects, otherwise it will be ignored and the rest of the smb.conf used. Rowland