我有一个小型 Samba,仅用于 ARM 设备上的文件共享 (SheevaPlug)。到目前为止,一切都很好,但我决定升级到 Debian 8.1,由于某种原因,共享无法正常工作。
每当设备启动时,我都无法访问 Samba 共享,它们会被公布,但我无法连接,我的操作系统说服务器不可用。
但是,如果我使用以下命令在设备上通过 SSH 手动重新启动 Samba:
service smbd restart
股票又开始发挥作用了。所以我决定调查日志文件并得到以下信息:
日志.nmbd:
[2015/08/08 22:45:54.596532, 0] ../lib/util/become_daemon.c:147(daemon_status)
STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).
[2015/08/08 22:45:59.599920, 0] ../lib/util/become_daemon.c:136(daemon_ready)
STATUS=daemon 'nmbd' finished starting up and ready to serve connections*****
日志.smbd:
2015/08/08 22:45:57.881551, 0] ../lib/util/become_daemon.c:136(daemon_ready)
STATUS=daemon 'smbd' finished starting up and ready to serve connectionsopen_sockets_smbd: No sockets available to bind to.
[2015/08/08 22:45:57.913376, 0] ../source3/lib/util.c:785(smb_panic_s3)
PANIC (pid 996): open_sockets_smbd() failed
[2015/08/08 22:45:57.923081, 0] ../source3/lib/util.c:896(log_stack_trace)
我猜 Samba 是在网络准备好并运行之前启动的,对吗?如果是,我该如何解决这个问题并确保在启动 Samba 之前网络实际上可用?
这是我当前的 Samba 配置:
[global]
workgroup = WORKGROUP
netbios name = Super-Share
server string = Super-Share
security = USER
invalid users = root
encrypt passwords = true
lanman auth = No
hosts allow = 127.0.0.1 172.20.1.0/24
hosts deny = 0.0.0.0/0
interfaces = eth0
bind interfaces only = yes
browseable = Yes
max protocol = smb2
socket options = TCP_NODELAY IPTOS_LOWDELAY
read raw = No
write raw = No
use sendfile = Yes
refresh = 1
max xmit = 131072
aio write behind = true
aio read size = 16384
aio write size = 16384
name resolve order = wins hosts lmhosts bcast
dns proxy = No
load printers = No
printing = bsd
printcap name = /dev/null
disable spoolss = yes
[SU1]
path = /mnt/SU1/SU1/
read only = No
guest ok = No
writable = yes
force user = root
force group = root
create mask = 0777
directory mask = 0777
谢谢。
编辑:
正如我所料,这是一个网络问题。如果我添加:
post-up /etc/init.d/smbd restart
在我/etc/network/interfaces
这里工作正常,但是很脏,我可以正确解决这个问题吗?
答案1
您可以设置bind interfaces only = no
,以便 Samba 将对接口列表中的更改做出反应。这不应该影响安全。
lo
包含在行内也不会有什么坏处interfaces
。