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
--
To unsubscribe from this list go to the following URL and read the
instructions: http://lists.samba.org/mailman/listinfo/samba