workgroups not recognized in virtual server conf files

Andrew Bartlett abartlet at pcug.org.au
Fri Dec 7 22:25:04 GMT 2001


"MCCALL,DON (HP-USA,ex1)" wrote:
> 
> Hi Joe,
> The 'virtual server' concept is not really going to work for you
> in the way you want; the problem is that all of the broadcasting,
> advertising server/workgroupnames, etc is done by nmbd.  While nmbd
> will broadcast/register/etc the netbios aliases, it is going to use
> only the smb.conf file, as the %L macro is only filled in at connection
> time (which means effectively, that only smbd is going to process include
> files with the %L macro).
> So while you COULD have netbios aliases that pointed to config files that
> did (for example) domain login, or share security, etc based on the netbios
> name that a pc is trying to connect as, all of your 'virtual machines' are
> going to be a member of the same 'workgroup', and that workgroup must be
> defined
> in the main smb.conf file, or as you have seen, it will just use the default
> 'WORKGROUP'.
> 
> You might want to peruse the archives mailing lists for ideas on how other
> people have
> tried to work around this.
> 
> Hope this helps,
> don
> -----Original Message-----
> From: D. Joe Anderson [mailto:deejoe at iastate.edu]
> Sent: Friday, December 07, 2001 10:16 AM
> To: Daniel Wittenberg
> Cc: cedarlug at cedarlug.org; aafugit at aafugit.org; samba at samba.org
> Subject: Re: workgroups not recognized in virtual server conf files
> 
> On Fri, Dec 07, 2001 at 12:21:04AM -0600, Daniel Wittenberg wrote:
> > Maybe I've missed something, but I'm curious why are have 2 config
> > files?  Why not just move the conf.test4 to smb.conf?  I assume you are
> > going to later be configuring multiple "servers"?
> 
> In short, yes.   I tried to say this in my original message.  Sorry if I
> wasn't able to make it clear here:
> 
> > > (If anyone is wondering why I bother with the 'netbios alias' line for
> just
> > > one netbios name, I tried this with three netbios aliases, expecting it
> to
> > > Just Work.  This is a simplified example.  If we can get this to work,
> I'll
> > > work my way back up ;-)
> 
> Basically, I want to keep %L in there, and have each virtual server handle a
> different workgroup.
> 
> But I can't get the workgroup setting read from any included files.  I
> thought maybe the complexity of my original conf files was hiding something,
> so I pared it down to this much simpler example in hopes that I could get it
> to work and isolate my problem, but even this simple example doesn't work.
> 
> This especially troubles me because as far as I can tell, it is nearly the
> same as the example given in "Running Samba"
> 
> http://www.oreilly.com/catalog/samba/chapter/book/ch04_07.html
> 
> I looked at this also with Samba 2.0.7 (instead of 2.2.2) and it behaves the
> same way, not picking up the workgroup setting from the included file, and
> in direct contradiction to the example given (unless I'm totally misreading
> that example on O'Reilly's site, and in my copy of their boo--I would be
> very happy to find out I missed something obvious!).
> 
> > It looks like the
> > reason it can't find "/etc/samba/conf."  is because the %L substitution
> > is missing the from the end - the "%L" part.  I would guess this is
> > because you first specify "netbios alias".
> 
> That error is from the instance of smbclient.  I can get rid of it by
> specifying, for instance
> 
> "smbclient -s /etc/samba/conf.test4"
> 
> but the server side still fails to recognize the workgroup setting as I
> would expect given the example.  Neither does specifying a workgroup from
> the client side (with -W) prompt the server to work within the proper
> workgroup.  It's not just in the top part of the smbclient response this
> doesn't work, it also shows up further down in the body, where workgroups
> and their domain master browsers our listed--my server gets listed as being
> the domain master browser for the generic WORKGROUP rather than for the
> specified "testwg".
> 
> > I would guess (never uesd
> > the aliases myself)  that if you set the netbios name = test4 in the
> > main smb.conf, and then set netbios alias = test4 in the include file
> > that would work better.  But, it doesn't make sense to me to use the %L,
> > since that is the netbios name, to define a virtual host for the netbios
> > server you've already created, to be able to use the name?  So why not
> > just leave the smb.conf empty, and use "include = /etc/samba/conf.test4"
> > instead?
> 
> because I want to put, for example, in smb.conf
> 
>         netbios alias = test3 test4 test5
>         include = /etc/samba/conf.%L
> 
> and then have multiple configuration files conf.test3 conf.test4 conf.test5
> etc, each in a different workgroup and with different settings.
> 
> Some I'd like to get running as primary domain controllers, behaving as an
> NT PDC would, others just to help sync browse lists across networks disjoint
> to smb broadcast traffic, and so forth.  I've got lots of different
> situations to handle, and not so many machines, so I could really, really
> use the flexibility of virtual servers, at least if I can get them to behave
> the way I think they should.
> 
> > I wonder if the workgroup and netbios alias info in the
> > smb.conf is confusing things.  So basically, I would say dump the
> > workgroup and netbios alias entries from the smb.conf, and change your
> > include line to include = /etc/samba/conf.test4, and see if that fixes
> > things.
> 
> This works, if I only wanted to run one name.  But I really do want to be
> able to run multiple virtual servers from one Samba process :-)
> 
> The sad thing is, that the virtual servers all seem to behave otherwise--I
> can connect to each one of them in turn, they show up on browse lists, and
> otherwise behave as if they were running each on its own machine, except for
> the fact that they are in the WORKGROUP workgroup, rather than the one I
> specify (eg, testwg3 testwg4 testwg5)
> 
> --Joe
> 
> > Dan
> >
> >
> >
> > On Thu, 2001-12-06 at 17:48, D. Joe Anderson wrote:
> > >
> > > Hi,
> > >
> > > The documentation I've read indicates that I should be able to get Samba
> to
> > > honor the value of the 'workgroup' variable as set from within an
> included
> > > virtual server configuration file.
> > >
> > > Given the configuration files below, if I comment out the
> > >
> > >   "workgroup = testwg"
> > >
> > > line from the main configuration file (smb.conf), then a query of
> > > the Samba server (with "smbclient -L test4 -U%") shows the server as
> being
> > > in the WORKGROUP workgroup, rather than the TESTWG workgroup that I
> specify
> > > in conf.test4.  The server still responds, however, to the TEST4 netbios
> > > name as specified in the included conf.test4 file.
> > >
> > > The only thing I can see that might be amiss is the line
> > >
> > >    Can't find include file /etc/samba/conf.
> > >
> > > When I run smbclient.
> > >
> > > I would appreciate any pointers as to how I might get the workgroup
> setting
> > > within the included file to be recognized.
> > >
> > > --Joe
> > >
> > >
> > > (If anyone is wondering why I bother with the 'netbios alias' line for
> just
> > > one netbios name, I tried this with three netbios aliases, expecting it
> to
> > > Just Work.  This is a simplified example.  If we can get this to work,
> I'll
> > > work my way back up ;-)
> > >
> > > $uname -a
> > > Linux xxx.xxx.iastate.edu 2.2.19-7.0.1 #1 Tue Apr 10 00:55:03 EDT 2001
> > > i686 unknown
> > >
> > > # rpm -q samba
> > > samba-2.2.2-20011013
> > >
> > >
> > > # cat smb.conf
> > >
> > > # Global parameters
> > >
> > > [global]
> > >          workgroup = testwg
> > >          netbios aliases = test4
> > >          include = /etc/samba/conf.%L
> > >
> > >
> > >
> > > # cat conf.test4
> > > [global]
> > >         workgroup = TESTWG
> > >         netbios name = TEST4
> > >         os level = 128
> > >         domain master = yes
> > >         local master = yes
> > >         preferred master = yes
> > >         security = user
> > >         status = yes
> > >         encrypt passwords = Yes
> > >         update encrypted = Yes
> > >         password level = 8
> > >         smb passwd file = /etc/samba/smbpasswd
> > >         log file = /var/log/samba/%L
> > >         log level = 4
> > >         max log size = 50
> > >         dns proxy = No
> > >         wins server = xxx.xxx.xxx.xxx
> > >         wins proxy = yes
> > >         guest account = ftp
> > >
> > > >From the test4 log:
> > >
> > >      135 [2001/12/06 17:42:50, 3] param/params.c:pm_process(579)
> > >      136   params.c:pm_process() - Processing configuration file
> > > "/etc/samba/smb
> > >      136 .conf"
> > >      137 [2001/12/06 17:42:50, 3] param/loadparm.c:do_section(2884)
> > >      138   Processing section "[global]"
> > >      139   doing parameter netbios aliases = webtest4
> > >      140   doing parameter include = /etc/samba/conf.%L
> > >      141 [2001/12/06 17:42:50, 3] param/params.c:pm_process(579)
> > >      142   params.c:pm_process() - Processing configuration file
> > > "/etc/samba/con
> > >      142 f.webtest4"
> > >      143 [2001/12/06 17:42:50, 3] param/loadparm.c:do_section(2884)
> > >      144   Processing section "[global]"
> > >      145   doing parameter workgroup = WEBTESTWG
> > >      146   doing parameter netbios name = WEBTEST4
> > >      147 [2001/12/06 17:42:50, 4]
> param/loadparm.c:handle_netbios_name(2251)
> > >      148   handle_netbios_name: set global_myname to: WEBTEST4
> > >      149   doing parameter os level = 128
> > >      150   doing parameter domain master = yes
> > >
> > > # smbclient -L test4 -U% | less
> > > Can't find include file /etc/samba/conf.
> > > added interface ip=129.186.xxx.6 bcast=129.186.xxx.255
> nmask=255.255.255.0
> > > added interface ip=129.186.yyy.138 bcast=129.186.yyy.255
> nmask=255.255.255.0
> > > Got a positive name query response from 129.186.xxx.6 ( 129.186.xxx.6 )
> > > Domain=[WORKGROUP] OS=[Unix] Server=[Samba 2.2.2]
> > >
> > >         Sharename      Type      Comment
> > >         ---------      ----      -------
> > >         IPC$           IPC       IPC Service (Samba 2.2.2)
> > >         ADMIN$         Disk      IPC Service (Samba 2.2.2)
> > >
> > >         Server               Comment
> > >         ---------            -------
> > >         TEST4                Samba 2.2.2
> > >         ANOTHERHOST          Samba 2.2.2
> > >
> > >         Workgroup            Master
> > >         ---------            -------
> > >         WORKGROUP

While the above still very much applies (for browsing you will only ever
see one workgroup) in Samba 3.0alpha, you will get the 'included'
workgorup in the 'domain=[]' line.  Not that its much use, but it will
be there...

Andrew Bartlett

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net




More information about the samba mailing list