указать рзмещение secrets.tdb для smbd
Приветствую!
Пытаюсь настроить SAMBA на 2 разных сетевушках с двумя разными конфигами, по аналогии с инструкцией:
http://wiki.samba.org/index.php/Multiple_Server_Instances
Итого, на текущий момент у меня получилось:
avr ~ # cat /etc/debian_version
6.0.4
avr ~ # cat /etc/hosts
127.0.0.1 localhost
192.168.0.205 avr.UIK.local avr
10.230.3.170 server.UIK server
avr ~ # dpkg -l | grep sam
ii samba 2:3.5.6~dfsg-3squeeze8 SMB/CIFS file, print, and login server for Unix
ii samba-common 2:3.5.6~dfsg-3squeeze8 common files used by both the Samba server and client
ii samba-common-bin 2:3.5.6~dfsg-3squeeze8 common files used by both the Samba server and client
avr ~ # testparm -s /etc/samba/smb-server.conf
Load smb config files from /etc/samba/smb-server.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Loaded services file OK.
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Server role: ROLE_STANDALONE
[global]
workgroup = UIK
netbios name = SERVER
interfaces = eth0
bind interfaces only = Yes
security = SHARE
private dir = /var/lib/samba-server
log level = 4
log file = /var/log/samba-server/log.%m
smb ports = 139
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
load printers = No
disable spoolss = Yes
show add printer wizard = No
preferred master = Yes
wins support = Yes
lock directory = /var/run/samba-server
state directory = /var/lib/samba-server
cache directory = /var/cache/samba-server
pid directory = /var/run/samba-server
guest ok = Yes
============модифицированный init скрипт=======================
avr ~ # cat /etc/init.d/samba-server
#!/bin/sh
### BEGIN INIT INFO
# Provides: samba-server
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Should-Start: slapd
# Should-Stop: slapd
# Short-Description: start Samba SERVER daemons (nmbd and smbd)
### END INIT INFO
# Defaults
RUN_MODE="daemons"
# Reads config file (will override defaults above)
#[ -r /etc/default/samba-server] && . /etc/default/samba-server
PIDDIR=/var/run/samba-server
NMBDPID=$PIDDIR/nmbd-smb-server.conf.pid
SMBDPID=$PIDDIR/smbd-smb-server.conf.pid
CONF=/etc/samba/smb-server.conf
# clear conflicting settings from the environment
unset TMPDIR
# See if the daemons are there
test -x /usr/sbin/nmbd -a -x /usr/sbin/smbd || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting Samba daemons in WKGP UIK and host SERVER"
# Make sure we have our PIDDIR, even if it's on a tmpfs
install -o root -g root -m 755 -d $PIDDIR
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' $CONF 2>/dev/null`
if [ "$NMBD_DISABLED" != 'Yes' ]; then
log_progress_msg "nmbd"
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/nmbd -- -D $NMBDOPTIONS -s $CONF
then
log_end_msg 1
exit 1
fi
fi
if [ "$RUN_MODE" != "inetd" ]; then
log_progress_msg "smbd"
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D $SMBDOPTIONS -s $CONF
then
log_end_msg 1
exit 1
fi
fi
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping Samba daemons SERVER"
log_progress_msg "nmbd"
start-stop-daemon --stop --quiet --pidfile $NMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $NMBDPID ] && ! ps h `cat $NMBDPID` > /dev/null
then
# Stale PID file (nmbd was succesfully stopped),
# remove it (should be removed by nmbd itself IMHO.)
rm -f $NMBDPID
fi
if [ "$RUN_MODE" != "inetd" ]; then
log_progress_msg "smbd"
start-stop-daemon --stop --quiet --pidfile $SMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
then
# Stale PID file (nmbd was succesfully stopped),
# remove it (should be removed by smbd itself IMHO.)
rm -f $SMBDPID
fi
fi
log_end_msg 0
;;
reload)
log_daemon_msg "Reloading /etc/samba/smb.conf" "smbd only on SERVER"
start-stop-daemon --stop --signal HUP --pidfile $SMBDPID
log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
status="0"
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' $CONF 2>/dev/null`
if [ "$NMBD_DISABLED" != "Yes" ]; then
status_of_proc -p $NMBDPID /usr/sbin/nmbd nmbd || status=$?
fi
if [ "$RUN_MODE" != "inetd" ]; then
status_of_proc -p $SMBDPID /usr/sbin/smbd smbd || status=$?
fi
if [ "$NMBD_DISABLED" = "Yes" -a "$RUN_MODE" = "inetd" ]; then
status="4"
fi
exit $status
;;
*)
echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
exit 1
;;
esac
exit 0
===========================
все бы хорошо, но при выполнении services samba-server start,
smbd отказывается запускаться, при этом в лог попадают сообщения о том, что невозможно прочитать файл /var/lib/samba/secrets.tdb:
----------------------------------------
[2012/05/06 00:13:32.795313, 2] lib/interface.c:340(add_interface)
added interface eth0 ip=10.230.3.170 bcast=10.230.3.255 netmask=255.255.255.0
[2012/05/06 00:13:32.796100, 2] lib/util_tdb.c:521(tdb_wrap_log)
tdb(unnamed): tdb_open_ex: could not open file /var/lib/samba/secrets.tdb: Нет такого файла или каталога
[2012/05/06 00:13:32.796348, 3] lib/dbwrap_tdb.c:357(db_open_tdb)
Could not open tdb: Нет такого файла или каталога
[2012/05/06 00:13:32.796540, 0] passdb/secrets.c:73(secrets_init)
Failed to open /var/lib/samba/secrets.tdb
[2012/05/06 00:13:32.798259, 3] smbd/server.c:1165(main)
loaded services
[2012/05/06 00:13:32.798439, 3] smbd/server.c:1180(main)
Becoming a daemon.
[2012/05/06 00:13:32.801010, 2] lib/util_tdb.c:521(tdb_wrap_log)
tdb(unnamed): tdb_open_ex: could not open file /var/lib/samba/secrets.tdb: Нет такого файла или каталога
[2012/05/06 00:13:32.803748, 3] lib/dbwrap_tdb.c:357(db_open_tdb)
Could not open tdb: Нет такого файла или каталога
[2012/05/06 00:13:32.803989, 0] passdb/secrets.c:73(secrets_init)
Failed to open /var/lib/samba/secrets.tdb
[2012/05/06 00:13:32.804802, 0] smbd/server.c:1223(main)
ERROR: smbd can not open secrets.tdb
----------------------------------------
согласно документации (http://www.samba.org/samba/docs/man/manpages/smb.conf.5.html#id2558309), параметр private dir задает расположение файла secrets.tdb, но почему smbd на это не реагирует?...
Может кто-то сталкивался?
P.S.
Попытался отправить баг, через reportbug, но он завершился ошибкой на этапе сбора информации:
-----------------------------
<...>
(72-114/114) Is the bug you found listed above [y|N|b|m|r|q|s|f|?]? n
Maintainer for samba is 'Debian Samba Maintainers <pkg-samba-maint@lists.alioth.debian.org>'.
Looking up dependencies of samba...
Getting changed configuration files...
Traceback (most recent call last):
File "/usr/bin/reportbug", line 2098, in <module>
main()
File "/usr/bin/reportbug", line 1045, in main
return iface.user_interface()
File "/usr/bin/reportbug", line 1155, in user_interface
main()
File "/usr/bin/reportbug", line 1045, in main
return iface.user_interface()
File "/usr/bin/reportbug", line 1733, in user_interface
conftext = conftext + u'%s %s\n' % (f, confinfo[f])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 10: ordinal not in range(128)
--
C Уважением,
Крамаренко Максим Анатольевич.
http://www.k-max.name/
Reply to: