我无法在新安装的 Samba 和 Centos 7 上获取文件更改通知。
我有两个服务器集群。一个运行 Centos 6.9 和较旧的 Samba 版本(3.6.23),另一个运行 Centos 7 和 Samba 版本 4.6.2
使用第一个,我可以通过映射网络驱动器使用 Windows 7 连接到 samba 共享。当文件发生更改时,我会立即在编辑器窗口中看到更新。
第二次我使用相同的凭据以相同的方式进行连接,但文件更新不存在。我必须关闭并重新打开文件才能看到所做的更改。
这种情况已经持续了几个月,我每隔几个月就会抽出时间研究这个问题,我花了几个小时试图修复它,但毫无成效。我在这个网站和谷歌上花了无数的时间。
以下是两个不同服务器集群的配置和共享信息。
集群 1:
uname -r:
2.6.32-696.13.2.el6.x86_64
lsb_release -a:
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.9 (Final)
Release: 6.9
Codename: Final
smbstatus:
Samba version 3.6.23-45.el6_9
PID Username Group Machine
-------------------------------------------------------------------
18490 user1 group1 comp1 (192.168.*.*)
21138 user2 user2 comp2 (192.168.*.*)
14315 user2 user2 comp3 (192.168.*.*)
Service pid machine Connected at
-------------------------------------------------------
share1 18490 comp1 Wed Mar 21 09:59:20 2018
share2 14315 comp3 Tue Mar 20 10:07:59 2018
share3 14315 comp3 Tue Mar 20 10:07:59 2018
share2 21138 comp2 Tue Mar 20 10:24:53 2018
No locked files
smb.conf:
[global]
workgroup = FSWD
server string = Samba Server Version %v
passdb backend = tdbsam
guest account = apache
cups options = raw
[websites]
comment = Virtual Hosts
path = /a/b/c
read only = No
create mask = 0644
directory mask = 0755
集群 2:
uname -r:
3.10.0-693.2.2.el7.x86_64
hostnamectl:
Static hostname: srv.home.com
Icon name: computer-vm
Chassis: vm
Machine ID: b8d0aff7632764daf448b26e28de2cd8
Boot ID: 4548a3abbc356918b77ae462a058728d
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-693.2.2.el7.x86_64
Architecture: x86-64
smbstatus:
Samba version 4.6.2
PID Username Group Machine Protocol Version Encryption Signing
----------------------------------------------------------------------------------------------------------------------------------------
1218 user1 group1 192.168.0.1 (ipv4:192.168.0.1:49969) SMB2_10 - -
1268 user1 group1 192.168.0.2 (ipv4:192.168.0.2:57232) SMB3_11 - partial(AES-128-CMAC)
Service pid Machine Connected at Encryption Signing
---------------------------------------------------------------------------------------------
share1 1268 192.168.0.2 Wed Mar 21 10:02:17 AM 2018 MDT - -
share2 1218 192.168.0.1 Wed Mar 21 09:59:20 AM 2018 MDT - -
Locked files:
Pid Uid DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d/e/f Wed Mar 21 10:10:46 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d/e/f Wed Mar 21 10:10:46 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d/e/f Wed Mar 21 10:12:09 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c . Wed Mar 21 10:10:50 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c . Wed Mar 21 10:12:09 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d/e/f/logs Wed Mar 21 10:10:45 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d/e/f/logs Wed Mar 21 10:10:46 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d/e/f/logs Wed Mar 21 10:12:09 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d/e Wed Mar 21 10:12:09 2018
1268 501 DENY_NONE 0x100081 RDONLY NONE /a/b/c d Wed Mar 21 10:12:09 2018
1218 501 DENY_ALL 0x100080 RDONLY NONE / . Wed Mar 21 09:59:43 2018
smb.conf:
[global]
workgroup = MYCOMPANY
server string = Samba Server Version %v
guest account = apache
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam
load printers = yes
cups options = raw
[homes]
comment = Home Directories
browseable = no
writable = yes
[main]
comment = Server Main
valid users = user1
path = /a/b/c
read only = No
writable = yes
force group = group1
create mask = 0664
directory mask = 0775