I am trying to run multiple instances of samba on the same unix host. This is being done so that I can functionally breakdown the usage into, for example, a "finance" server and an "engineering" server. This is not based upon the client or the user, but based upon the virtual server. My first attempts were a real problem in that, though the config file could be specified on the command line that starts smbd, the multiple instances would walk all over each others lock files, etc. I fixed this by compiling multiple versions of samba with different values for --prefix, etc. I later found that this is not the best way. Somebody suggested just using a line like: include = /etc/samba/smb.conf.%L in my smb.conf file. This would simplify things and would make "smbstatus" show all connections, etc. It is now time to upgrade from 2.2.5 to 2.2.7 and that is what I want to do. Unfortunately the latest man pages say: %L the NetBIOS name of the server. This allows you to change your config based on what the client calls you. Your server can have a "dual personality". Note that this paramater is not available when Samba listens on port 445, as clients no longer send this information So, the question is: how do I do it now? I tried %h but that does not seem to be the same thing? How can I get something based upon how the user refered to the server? Shouldn't there be a way to use the IP address from a getsockname() call? I do have interfaces set to several addresses, btw. Also, how do I know if samba is listening on port 445? There seems to be no other mention in the man page. (I do know it isn't because "lsof" does not show it). -- Gary Algier, WB2FWZ gaa at ulticom.com +1 856 787 2758 Ulticom Inc., 1020 Briggs Rd, Mt. Laurel, NJ 08054 Fax:+1 856 866 2033
A followup to my own post: I went ahead and implemented a configuration with %L. It works great. One problem: Micro@!#$t broke Win2k with SP3. My test PC was running Win2k SP2. When it connected to the server it seems to have supplied the "netbios name" of my server. I went into my boss's office to show him how great this works and his Win2k SP3 did not show the same shares. They showed the shares that would show if the "real" host name is used. Here's my basic config: System OS: Solaris 2.6 Samba: 2.2.7 Hostname: tea IP addresses assigned: 172.25.0.13 (tea) 172.25.0.33 (cup) 172.25.0.34 (mug) Partial configs: /etc/samba/smb.conf: [global] interfaces = 127.0.0.1 172.25.0.13 172.25.0.33 172.25.0.34 include = /etc/samba/smb.conf.host-%L /etc/samba/smb.conf.host-tea: [global] workgroup = MTLAUREL netbios name = TEA ... [some-shares] ... /etc/samba/smb.conf.host-cup: [global] workgroup = MTLAUREL netbios name = Cup [other-shares] ... /etc/samba/smb.conf.host-mug: [global] workgroup = MTLAUREL netbios name = Cup [more-shares] ... So, am I crazy to think of using %L? Should I use another (hidden) % code? Should I hack in %s (for sockname) or %l (for alternate %L) as the result of getsockname()? Will this even work? Is this any different in samba 3? Gary Algier wrote:> I am trying to run multiple instances of samba on the same unix host. This > is being done so that I can functionally breakdown the usage into, for > example, a "finance" server and an "engineering" server. This is not > based upon the client or the user, but based upon the virtual server. > > My first attempts were a real problem in that, though the config file > could be specified on the command line that starts smbd, the multiple > instances would walk all over each others lock files, etc. I fixed this > by compiling multiple versions of samba with different values for > --prefix, etc. > > I later found that this is not the best way. Somebody suggested just using > a line like: > include = /etc/samba/smb.conf.%L > in my smb.conf file. This would simplify things and would make > "smbstatus" show all connections, etc. > > It is now time to upgrade from 2.2.5 to 2.2.7 and that is what I want to > do. > Unfortunately the latest man pages say: > %L the NetBIOS name of the server. This allows you to > change your config based on what the client calls you. > Your server can have a "dual personality". > > Note that this paramater is not available when Samba > listens on port 445, as clients no longer send this > information > > So, the question is: how do I do it now? I tried %h but that does not > seem > to be the same thing? How can I get something based upon how the user > refered to the server? Shouldn't there be a way to use the IP address from > a getsockname() call? I do have interfaces set to several addresses, btw. > > Also, how do I know if samba is listening on port 445? There seems to be > no other mention in the man page. (I do know it isn't because "lsof" does > not show it). > >-- Gary Algier, WB2FWZ gaa at ulticom.com +1 856 787 2758 Ulticom Inc., 1020 Briggs Rd, Mt. Laurel, NJ 08054 Fax:+1 856 866 2033
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> Message: 6 > Date: Wed, 04 Dec 2002 16:43:01 -0500 > From: Gary Algier <gaa@ulticom.com> > To: samba@lists.samba.org > Subject: Re: [Samba] Won't %L work anymore? > > A followup to my own post: > > I went ahead and implemented a configuration with %L. It works great. > One problem: Micro@!#$t broke Win2k with SP3. > > My test PC was running Win2k SP2. When it connected to the server it > seems to have supplied the "netbios name" of my server. I went into > my boss's office to show him how great this works and his Win2k SP3 > did not show the same shares. They showed the shares that would > show if the "real" host name is used. > > Here's my basic config: > > System OS: Solaris 2.6 > Samba: 2.2.7 > Hostname: tea > IP addresses assigned: 172.25.0.13 (tea) 172.25.0.33 (cup) 172.25.0.34(mug)> Partial configs: > /etc/samba/smb.conf: > [global] > interfaces = 127.0.0.1 172.25.0.13 172.25.0.33 172.25.0.34#You probably want to try adding right here: netbios name = beverages netbios aliases = tea cup mug> include = /etc/samba/smb.conf.host-%L > /etc/samba/smb.conf.host-tea:> [global] > workgroup = MTLAUREL^^^^^^^^^^^^^^^^^^^^ I don't think this will work if you have different workgroups listed here, I suspect you would have to run seperate smbd's with different config files if you want to do this.> netbios name = TEAUnnecessary, use netbios aliases instead.> ... > [some-shares] > ... > /etc/samba/smb.conf.host-cup: > [global] > workgroup = MTLAUREL > netbios name = Cup > [other-shares] > ... > /etc/samba/smb.conf.host-mug: > [global] > workgroup = MTLAUREL > netbios name = Cup > [more-shares] > ... > > So, am I crazy to think of using %L? Should I use another (hidden) %code?> Should I hack in %s (for sockname) or %l (for alternate %L) as the result > of getsockname()? Will this even work? Is this any different in samba 3?- -- |--------------Another happy Mandrake Club member--------------| Buchan Milne Mechanical Engineer, Network Manager Cellphone * Work +27 82 472 2231 * +27 21 8828820x121 Stellenbosch Automotive Engineering http://www.cae.co.za GPG Key http://ranger.dnsalias.com/bgmilne.asc 1024D/60D204A7 2919 E232 5610 A038 87B1 72D6 AC92 BA50 60D2 04A7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE971hprJK6UGDSBKcRAoWwAJ9Cs3Nrj0Nt1CRpJ+KXg2F0H8AEQQCeKJKz O4KUgm7icTFgpol4tVHUqCQ=Wu93 -----END PGP SIGNATURE-----