multiple samba instances

Hi there

after some try and error I got 2 instances of my samba server running (even with the correct conf’s), but still there are some things I need help with:

  1. samba and/or nmb come up differently at each boot (power was not off every time; a power off even more changed behaviour of the smbd/nmbd). Usually the nmbd comes up for both instances, smbd only for one. Sometimes the second instance comes up after a few minutes.
  2. smb access (if running) runs fine for both servers (IP access), nmb (after about 5 minutes) access works only for Aquarium, GallischesDorf usually times out.
  3. sometimes XP vmware client access works on alternatively one server, in rare cases even both), but never 11.1 client or even local access to GallischesDorf
  4. sometimes after rebooting the nmblookup cries for a missing unexpected.tdb (this seems to happen when nothing seems to work except IP access to smbd)

My configuration (it’s not perfect, beeing new to linux…):

SUSE 11.1-x64 KDE4 with all SUSE updates on a Intel Q6600 / GA-G33 machine
eth0 LAN, vmnet1 (both server GallischesDorf, vmnet6 (server Aquarium)
users are registered with passwords, firewall is explicitly switched off for all mentioned networks
server’s nmblookup and smbstatus states OK for both servers

The scripts and conf’s are based on a working single samba server configuration (before starting to try a dual samba) and the startup scripts modified for dual server start.

modified smb.pl

#! /bin/sh

Copyright (c) 1999-2004 SuSE Linux AG, Nuernberg, Germany.

All rights reserved.

Author: Lars Mueller <lmuelle@suse.de>

/etc/init.d/smb

and its symbolic link

/usr/sbin/rcsmb

BEGIN INIT INFO

Provides: smb

Required-Start: $network $remote_fs $syslog

Should-Start: cupsd winbind nmb

Required-Stop: $network $remote_fs $syslog

Should-Stop: cupsd winbind nmb

Default-Start: 3 5

Default-Stop: 0 1 2 6

Short-Description: Samba SMB/CIFS file and print server

Description: Samba SMB/CIFS file and print server

END INIT INFO

SMBD_BIN="/usr/sbin/smbd"
SMB_CONF_GallischesDorf="/etc/samba/GallischesDorf/smb.conf.GallischesDorf"
SMB_CONF_Aquarium="/etc/samba/Aquarium/smb.conf.Aquarium"
PID_FILE_GallischesDorf="/var/run/samba/GallischesDorf/smbd-smb.conf.GallischesDorf.pid"
PID_FILE_Aquarium="/var/run/samba/Aquarium/smbd-smb.conf.Aquarium.pid"

. /etc/rc.status
rc_reset

Check for missing binary

if ! -x ${SMBD_BIN} ]; then
echo -n >&2 "Samba SMB daemon, ${SMBD_BIN} is not installed. "
rc_status -s
exit 5
fi

be extra carefull cause connection fail if TMPDIR is not writeable

export TMPDIR="/var/tmp"

test -f /etc/sysconfig/samba &&
. /etc/sysconfig/samba

for setting in $SAMBA_SMBD_ENV; do
pathcheck="${setting%%:}"
variable="${setting##
:}"
test “${pathcheck}” != “${variable}” -a ! -e “${pathcheck}” &&
continue
export eval ${variable}
done

case “$1” in
start)
echo "Starting Samba SMB daemon "
if ! -f ${SMB_CONF_GallischesDorf} ]; then
echo >&2 “Samba configuration file, ${SMB_CONF_GallischesDorf} does not exist. "
rc_status -s
exit 6
fi
if ! -f ${SMB_CONF_Aquarium} ]; then
echo >&2 “Samba configuration file, ${SMB_CONF_Aquarium} does not exist. "
rc_status -s
exit 6
fi
checkproc -p ${PID_FILE_GallischesDorf} ${SMBD_BIN}
case $? in
0) echo “- Warning: daemon ${PID_FILE_GallischesDorf} already running. " ;;
1) echo “- Warning: ${PID_FILE_GallischesDorf} exists. " ;;
esac
checkproc -p ${PID_FILE_Aquarium} ${SMBD_BIN}
case $? in
0) echo “- Warning: daemon ${PID_FILE_Aquarium} already running. " ;;
1) echo “- Warning: ${PID_FILE_Aquarium} exists. " ;;
esac
test -f /etc/sysconfig/language &&
. /etc/sysconfig/language
export LC_ALL=”$RC_LC_ALL”
export LC_CTYPE=”$RC_LC_CTYPE”
export LANG=”$RC_LANG”
startproc -f -p ${PID_FILE_GallischesDorf} ${SMBD_BIN} -D -s ${SMB_CONF_GallischesDorf}
startproc -f -p ${PID_FILE_Aquarium} ${SMBD_BIN} -D -s ${SMB_CONF_Aquarium}
unset LC_ALL LC_CTYPE LANG
rc_status -v
;;
stop)
echo "Shutting down Samba SMB daemon "
checkproc -p ${PID_FILE_GallischesDorf} ${SMBD_BIN} ||
echo " Warning: daemon ${PID_FILE_GallischesDorf} is not running. "
killproc -p ${PID_FILE_GallischesDorf} -t 10 ${SMBD_BIN}
rc_status -v
checkproc -p ${PID_FILE_Aquarium} ${SMBD_BIN} ||
echo " Warning: daemon ${PID_FILE_Aquarium} is not running. "
killproc -p ${PID_FILE_Aquarium} -t 10 ${SMBD_BIN}
rc_status -v
;;
try-restart|condrestart)
if test “$1” = “condrestart”; then
echo “${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}”
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload|reload)
echo -n "Reloading Samba SMB daemon "
checkproc -p ${PID_FILE_GallischesDorf} ${SMBD_BIN} &&
touch ${PID_FILE_GallischesDorf} ||
echo -n >&2 " Warning: daemon ${PID_FILE_GallischesDorf} not running. "
killproc -p ${PID_FILE_GallischesDorf} -HUP ${SMBD_BIN}
rc_status -v
checkproc -p ${PID_FILE_Aquarium} ${SMBD_BIN} &&
touch ${PID_FILE_Aquarium} ||
echo -n >&2 " Warning: daemon ${PID_FILE_Aquarium} not running. "
killproc -p ${PID_FILE_Aquarium} -HUP ${SMBD_BIN}
rc_status -v
;;
status)
echo "Checking for Samba SMB daemon "
checkproc -p ${PID_FILE_GallischesDorf} ${SMBD_BIN}
echo -n "${PID_FILE_GallischesDorf} "
rc_status -v
checkproc -p ${PID_FILE_Aquarium} ${SMBD_BIN}
echo -n "${PID_FILE_Aquarium} "
rc_status -v
;;
probe)
test ${SMB_CONF_GallischesDorf} -nt ${PID_FILE_GallischesDorf} && echo reload
rc_status -v
test ${SMB_CONF_Aquarium} -nt ${PID_FILE_Aquarium} && echo reload
rc_status -v
;;
*)
echo “Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}”
exit 1
;;
esac
rc_exit

and nmb.pl

#! /bin/sh

Copyright (c) 2002-2004 SuSE Linux AG, Nuernberg, Germany.

All rights reserved.

Author: Lars Mueller <lmuelle@suse.de>

/etc/init.d/nmb

and its symbolic link

/usr/sbin/rcnmb

BEGIN INIT INFO

Provides: nmb

Required-Start: $network $syslog

Should-Start: $null

Required-Stop: $network $syslog

Should-Stop: $null

Default-Start: 3 5

Default-Stop: 0 1 2 6

Short-Description: Samba NetBIOS naming service over IP

Description: Samba NetBIOS naming service over IP

END INIT INFO

NMBD_BIN="/usr/sbin/nmbd"
NMBD_NAMELIST="/var/lib/samba/namelist.debug"
SMB_CONF_GallischesDorf="/etc/samba/GallischesDorf/smb.conf.GallischesDorf"
SMB_CONF_Aquarium="/etc/samba/Aquarium/smb.conf.Aquarium"
PID_FILE_GallischesDorf="/var/run/samba/GallischesDorf/nmbd-smb.conf.GallischesDorf.pid"
PID_FILE_Aquarium="/var/run/samba/Aquarium/nmbd-smb.conf.Aquarium.pid"

. /etc/rc.status
rc_reset

Check for missing binary

if ! -x ${NMBD_BIN} ]; then
echo -n >&2 "Samba NMB daemon, ${NMBD_BIN} is not installed. "
rc_status -s
exit 5
fi

test -f /etc/sysconfig/samba &&
. /etc/sysconfig/samba

for setting in $SAMBA_NMBD_ENV; do
pathcheck="${setting%%:}"
variable="${setting##
:}"
test “${pathcheck}” != “${variable}” -a ! -e “${pathcheck}” &&
continue
export eval ${variable}
done

case “$1” in
start)
echo "Starting Samba NMB daemon "
if ! -f ${SMB_CONF_GallischesDorf} ]; then
echo >&2 "Samba configuration file, ${SMB_CONF_GallischesDorf} does not exist. "
rc_status -s
exit 6
fi
if ! -f ${SMB_CONF_Aquarium} ]; then
echo >&2 "Samba configuration file, ${SMB_CONF_Aquarium} does not exist. "
rc_status -s
exit 6
fi
checkproc -p ${PID_FILE_GallischesDorf} ${NMBD_BIN}
case $? in
0) echo "- Warning: daemon ${PID_FILE_GallischesDorf} already running. "
exit 6
;;
1) echo "- Warning: ${PID_FILE_GallischesDorf} exists. "
exit 6
;;
esac
checkproc -p ${PID_FILE_Aquarium} ${NMBD_BIN}
case $? in
0) echo "- Warning: daemon ${PID_FILE_Aquarium} already running. "
exit 6
;;
1) echo "- Warning: ${PID_FILE_Aquarium} exists. "
exit 6
;;
esac
startproc -f -p ${PID_FILE_GallischesDorf} ${NMBD_BIN} -D -s ${SMB_CONF_GallischesDorf}
startproc -f -p ${PID_FILE_Aquarium} ${NMBD_BIN} -D -s ${SMB_CONF_Aquarium}
rc_status -v
;;
stop)
echo "Shutting down Samba NMB daemon "
checkproc -p ${PID_FILE_GallischesDorf} ${NMBD_BIN} ||
echo " Warning: daemon ${PID_FILE_GallischesDorf} not running. "
killproc -p ${PID_FILE_GallischesDorf} -t 10 ${NMBD_BIN}
rc_status -v
checkproc -p ${PID_FILE_Aquarium} ${NMBD_BIN} ||
echo " Warning: daemon ${PID_FILE_Aquarium} not running. "
killproc -p ${PID_FILE_Aquarium} -t 10 ${NMBD_BIN}
rc_status -v
;;
try-restart|condrestart)
if test “$1” = “condrestart”; then
echo “${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}”
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
$0 try-restart
rc_status
;;
reload)
echo -n "Reloading Samba NMB daemon "
rc_failed 3
rc_status -v
;;
dump-nmbd)
echo "Dump Samba NMB daemon namelists to ${NMBD_NAMELIST}. "
checkproc -p ${PID_FILE_GallischesDorf} ${NMBD_BIN} ||
echo " Warning: daemon ${PID_FILE_GallischesDorf} not running. "
killproc -p ${PID_FILE_GallischesDorf} -HUP ${NMBD_BIN}
rc_status -v
checkproc -p ${PID_FILE_Aquarium} ${NMBD_BIN} ||
echo " Warning: daemon ${PID_FILE_Aquarium} not running. "
killproc -p ${PID_FILE_Aquarium} -HUP ${NMBD_BIN}
rc_status -v
;;
status)
echo -n "Checking for Samba NMB daemon "
checkproc -p ${PID_FILE_GallischesDorf} ${NMBD_BIN}
rc_status -v
checkproc -p ${PID_FILE_Aquarium} ${NMBD_BIN}
rc_status -v
;;
probe)
test ${SMB_CONF_GallischesDorf} -nt ${PID_FILE_GallischesDorf} && echo restart
test ${SMB_CONF_Aquarium} -nt ${PID_FILE_Aquarium} && echo restart
;;
*)
echo “Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe|dump-nmbd}”
exit 1
;;
esac
rc_exit

The conf files are:

GallischesDorf:

smb.conf.GallischesDorf is the Samba configuration file for Workgroup Aremorica (green).

Date: 2009-06-04

[global]
workgroup = AREMORICA
netbios name = GALLISCHESDORF

bind interfaces only = yes
interfaces = eth1 vmnet1 127.0.0.1/8

printcap name = cups
cups options = raw
map to guest = Bad User
include = /etc/samba/GallischesDorf/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = No
usershare max shares = 100
wins support = Yes

pid directory = /var/run/samba/GallischesDorf/
lock directory = /var/run/samba/GallischesDorf/
private dir = /etc/samba/GallischesDorf/

[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = Yes
read only = No
inherit acls = Yes

[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/

[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes

[fileserver1]
inherit acls = yes
path = /home/steme/system/Fileserver1a/
read only = no

[11_video]
inherit acls = Yes
path = /home/steme/system/Fileserver1a/11_Video/
read only = No

[44_transfer]
inherit acls = Yes
path = /home/steme/system/Fileserver1a/44_Transfer
read only = No

and for Aquarium:

smb.conf.Aquarium is the Samba configuration file for workgroup GotischesReich (orange).

Date: 2009-06-04

[global]
workgroup = GOTISCHESREICH
netbios name = AQUARIUM

bind interfaces only = yes
interfaces = vmnet6

printcap name = cups
cups options = raw
map to guest = Bad User
include = /etc/samba/Aquarium/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = No
usershare max shares = 100
wins support = Yes

pid directory = /var/run/samba/Aquarium/
lock directory = /var/run/samba/Aquarium/
private dir = /etc/samba/Aquarium/

[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775

[44_transfer]
inherit acls = Yes
path = /home/steme/system/Fileserver1a/44_Transfer
read only = No

Any ideas?
Any other information required?

Thanks

Stefan