[Samba] multiple smb deamons
Eric Boehm
boehm at nortelnetworks.com
Thu Feb 7 05:43:12 GMT 2002
On Thu, Feb 07, 2002 at 03:57:46AM +0200, Antonis Lazaridis wrote:
>>>>> "Antonis" == Antonis Lazaridis <antonis_san at hotmail.com> writes:
Antonis> Hello everybody, i have a question for the list.
Antonis> Q: How do i start multiple smbd's, with different config
Antonis> files?
Antonis> Here is why i need this, maybe someone has a better idea:
Antonis> I want to share different folders through differnt
Antonis> IPs. The reason i want to do this, is to test QoS.
Antonis> Something like this:
Antonis> Folder A: 10 Mbps. Shared through IP1. Folder B: 1
Antonis> Mbps. Shared through IP2.
Antonis> So, in order to difeerentiate the packets, i want to use
Antonis> different IPs.
I use a startup file that is included below.
Briefly, I get all the hostnames from /etc/hostname.hme[0-9] and
/etc/hostname.qfe[0-9] (this is for Solaris 8). I then check to see if
an smb.conf.${hostname} file exists. If it does, then I start and
smbd/nmbd pair with the appropriate smb.conf file.
As to the smb.conf.${hostname} file, you have the following
considerations
You will need to specify
1. log file = /usr/local/samba/var/HOSTNAME/log.%m
directive in order to keep the logs for the daemons separate. Make
sure the directory exists before you start smbd.
2. interfaces = "IP_ADDRESS/NETMASK"
appropriate to the particular interface. NETMASK can be a bit
length or full netmask in dotted decimal form. NOTE: One (and only
one) of the smb.conf files will need
interfaces = "IP_ADDRESS/NETMASK 127.0.0.1/8"
3. socket address = IP_ADDRESS
4. bind interfaces only = yes
5. lock directory = /usr/local/samba/var/HOSTNAME/locks
to keep the locks separate. Make sure the directory exists before
you start smbd.
6. If you are using "security = domain" then you will need a machine
account for each interface hostname and you will need to add
netbios name = HOSTNAME
with the appropriate HOSTNAME for each interface
------------------------------------------------------------------------------
Startup script (/etc/init.d/samba)
------------------------------------------------------------------------------
#!/bin/sh
#ident "@(#)samba.server 1.0 96/06/19 TK" /* SVr4.0 1.1.13.1*/
#
# Please send info on modifications to knuutila at cs.utu.fi
#
# This file should have uid root, gid sys and chmod 744
#
if [ ! -d /usr/bin ]
then # /usr not mounted
exit
fi
killproc() { # kill the named process(es)
pid=`/usr/bin/ps -e |
/usr/bin/grep -w $1 |
/usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
[ "$pid" != "" ] && kill $pid
}
# Start/stop processes required for samba server
SAMBA_HOME="/usr/local/samba"
SAMBA_BIN="${SAMBA_HOME}/bin"
SAMBA_LIB="${SAMBA_HOME}/lib"
SAMBA_VAR="${SAMBA_HOME}/var"
SMBD="${SAMBA_BIN}/smbd"
NMBD="${SAMBA_BIN}/nmbd"
DO_INTERFACES=1
case "$1" in
'start')
#
# Edit these lines to suit your installation (paths, workgroup, host)
#
if [ ${DO_INTERFACES} -eq 1 ]
then
INTERFACES="`cat /etc/hostname.[hq][mf]e[0-9]`"
for host in $INTERFACES
do
SMB_CONF="${SAMBA_LIB}/smb.conf.${host}"
[ -r ${SMB_CONF} ] || continue
${SMBD} -D -l ${SAMBA_VAR}/${host}/log.smb -s ${SMB_CONF}
${NMBD} -D -l ${SAMBA_VAR}/${host}/log -s ${SMB_CONF}
done
else
${SMBD} -D
${NMBD} -D
fi
;;
'stop')
killproc nmbd
killproc smbd
;;
*)
echo "Usage: /etc/init.d/samba { start | stop }"
;;
esac
------------------------------------------------------------------------------
Sample smb.conf files. For example, given two interfaces with
hostnames ZNC0S0K1 and ZRTPS073 (system primary hostname is
ZNC0S0K1). In my case, all interfaces had the same set of shares from
smb.conf.shares.znc0s0k1. In your case, you may want different shares
for the different interfaces.
------------------------------------------------------------------------------
smb.conf.znc0s0k0
------------------------------------------------------------------------------# Global parameters
client code page = 437
# Samba requests 10000 but Solaris has only 1014 to spare
#max open files = 1014
comment = "Samba %v server"
share modes = yes
getwd cache = yes
browseable = yes
load printers = no
local master = no
username map = /usr/local/samba/lib/username.map
debug pid = yes
dead time = 30
#debug level = 5
log file = /usr/local/samba/var/znc0s0k1/log.%m
socket options = TCP_NODELAY SO_KEEPALIVE SO_SNDBUF=32768 SO_RCVBUF=32768
include = /usr/local/samba/lib/smb.conf.global.znc0s0k1
include = /usr/local/samba/lib/smb.conf.shares.%h
------------------------------------------------------------------------------
smb.conf.global.znc0s0k1
------------------------------------------------------------------------------
[global]
workgroup = PCNTRTP
security = domain
password server = PCNTRTP01, ZRTPD0P0, PCNTRTP02
#workgroup = AMERICASE
#security = server
#password server = ZRTPD01T, NRTPDE11, ZRTPD01R, ZRTPD0P0
encrypt passwords = yes
wins server = 47.156.160.179
server string = "DDMS/IPSVC/PNM/SAM21/TOPS/UAS ClearCase VOB Server %h (%L), Samba"
interfaces = "47.142.76.26/24 127.0.0.1/8"
socket address = 47.142.76.26
bind interfaces only = yes
lock directory = /usr/local/samba/var/znc0s0k1/locks
netbios name = ZNC0S0K1
shared mem size = 4194304
------------------------------------------------------------------------------
smb.conf.zrtps073
------------------------------------------------------------------------------
# Global parameters
client code page = 437
# Samba requests 10000 but Solaris has only 1014 to spare
#max open files = 1014
comment = "Samba %v server"
share modes = yes
getwd cache = yes
browseable = yes
load printers = no
local master = no
username map = /usr/local/samba/lib/username.map
debug pid = yes
dead time = 30
#debug level = 3
log file = /usr/local/samba/var/zrtps073/log.%m
socket options = TCP_NODELAY SO_KEEPALIVE SO_SNDBUF=32768 SO_RCVBUF=32768
include = /usr/local/samba/lib/smb.conf.global.zrtps073
include = /usr/local/samba/lib/smb.conf.shares.%h
------------------------------------------------------------------------------
smb.conf.global.zrtps073
------------------------------------------------------------------------------
[global]
workgroup = PCNTRTP
security = domain
password server = PCNTRTP01, PCNTRTP02
#workgroup = AMERICASE
#security = server
#password server = ZRTPD01T, NRTPDE11, ZRTPD01R, ZRTPD0P0
encrypt passwords = yes
wins server = 47.156.160.179
server string = "DDMS/IPSVC/PNM/SAM21/TOPS/UAS ClearCase VOB Server %h (%L), Samba"
interfaces = "47.140.7.210/20"
socket address = 47.140.7.210
bind interfaces only = yes
lock directory = /usr/local/samba/var/zrtps073/locks
netbios name = ZRTPS073
shared mem size = 4194304
--
Eric M. Boehm /"\ ASCII Ribbon Campaign
boehm at nortelnetworks.com \ / No HTML or RTF in mail
X No proprietary word-processing
/ \ files in mail
/ \ Respect Open Standards
More information about the samba
mailing list