samba + ms excel 锁定文件

samba + ms excel 锁定文件

我们有 Samba 服务器,其中有很多文档。

服务器位于繁忙的局域网中,但只有两台计算机使用两个 samba 用户帐户在那里工作。

Microsoft Excel 经常无法打开或无法保存特定文件。

这是我的 samba 配置文件:

[global]
        server role = standalone server
        workgroup = WORKGROUP
        server string = nas
        hosts allow = 127. 192.168. 1. 10.

        log file = /var/log/samba/%m.log
        # max 50KB per log file, then rotate
;       max log size = 50

;       security = share
        # is replacd now with:
        security = user
        map to guest = Bad User

;       passdb backend = tdbsam

        load printers = no
        disable spoolss = yes

        # prevent printing errors
        printing = bsd
        printcap name = /dev/null

        map readonly = no
        map system = no
        create mask = 0644

        # stop avahi
        multicast dns register = no

        LANMAN auth = no
        NTLM auth = no
        invalid users = root

;       http://zyxel.nas-central.org/wiki/NFS_and_Samba/CIFS
        kernel oplocks = no

[incoming]
        comment = Incoming
        path = /SHARES/incoming
        guest ok = yes
        public = yes
        writable = yes
        printable = no
        force user = nas

;       http://zyxel.nas-central.org/wiki/NFS_and_Samba/CIFS
        oplocks = no
        blocking locks = no
        strict locking = no
        locking = no

        veto oplock files = /*.xls/*.XLS/*.xlsx/*.XLSX/*.doc/*.DOC/*.docx/*.DOCX/~$*/
        reset on zero vc = yes

以下是文件被锁定时 smbstatus 显示的内容:

Samba version 4.6.5
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
----------------------------------------------------------------------------------------------------------------------------------------
15403   nobody       nobody       192.168.1.6 (ipv4:192.168.1.6:64279)      SMB3_11           -                    -
15420   nobody       nobody       192.168.1.19 (ipv4:192.168.1.19:61179)    SMB3_11           -                    -
15388   nobody       nobody       192.168.1.6 (ipv4:192.168.1.6:63303)      SMB3_11           -                    -
15392   nobody       nobody       192.168.1.22 (ipv4:192.168.1.22:63832)    SMB3_11           -                    -
15406   nobody       nobody       192.168.1.22 (ipv4:192.168.1.22:64421)    SMB3_11           -                    -
15402   nobody       nobody       192.168.1.22 (ipv4:192.168.1.22:64194)    SMB3_11           -                    -
15385   nobody       nobody       192.168.1.19 (ipv4:192.168.1.19:60342)    SMB3_11           -                    -
15404   nobody       nobody       192.168.1.32 (ipv4:192.168.1.32:60939)    SMB3_11           -                    -
15400   nobody       nobody       192.168.1.22 (ipv4:192.168.1.22:63985)    SMB3_11           -                    -
15398   nobody       nobody       192.168.1.6 (ipv4:192.168.1.6:63928)      SMB3_11           -                    -
15397   nobody       nobody       192.168.1.25 (ipv4:192.168.1.25:54630)    SMB3_11           -                    -

Service      pid     Machine       Connected at                     Encryption   Signing
---------------------------------------------------------------------------------------------
incoming     15400   192.168.1.22  Tue Aug  8 09:18:19 2017 EEST    -            -
incoming     15388   192.168.1.6   Tue Aug  8 08:50:59 2017 EEST    -            -
incoming     15392   192.168.1.22  Tue Aug  8 09:00:18 2017 EEST    -            -
incoming     15397   192.168.1.25  Tue Aug  8 09:16:57 2017 EEST    -            -
incoming     15420   192.168.1.19  Tue Aug  8 09:30:29 2017 EEST    -            -
incoming     15385   192.168.1.19  Tue Aug  8 08:45:32 2017 EEST    -            -
incoming     15403   192.168.1.6   Tue Aug  8 09:25:41 2017 EEST    -            -
incoming     15406   192.168.1.22  Tue Aug  8 09:29:05 2017 EEST    -            -
incoming     15404   192.168.1.32  Tue Aug  8 09:27:55 2017 EEST    -            -
incoming     15402   192.168.1.22  Tue Aug  8 09:23:24 2017 EEST    -            -
incoming     15398   192.168.1.6   Tue Aug  8 09:17:41 2017 EEST    -            -

Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
--------------------------------------------------------------------------------------------------
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Hotel all files/Winter 2017 - 2018/Borovets/Euphoria   Tue Aug  8 09:06:18 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Hotel all files/Winter 2017 - 2018/Borovets/Euphoria   Tue Aug  8 09:06:18 2017
15397        1000       DENY_NONE  0x80        RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:16:57 2017
15388        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 08:51:52 2017
15388        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 08:51:52 2017
15388        1000       DENY_NONE  0x80        RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 08:51:53 2017
15392        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:00:23 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:06:18 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:20:10 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:20:17 2017
15402        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:23:27 2017
15403        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:26:15 2017
15404        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:28:20 2017
15420        1000       DENY_NONE  0x80        RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:30:29 2017
15406        1000       DENY_NONE  0x100080    RDONLY     NONE             /DATA/SMB/incoming   .   Tue Aug  8 09:32:33 2017
15388        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   ПРОФОРМИ/OLD   Tue Aug  8 08:51:53 2017
15388        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   ПРОФОРМИ/OLD   Tue Aug  8 08:51:53 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   WINTER 2017-2018   Tue Aug  8 09:06:18 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   WINTER 2017-2018   Tue Aug  8 09:06:18 2017
>>> 15392        1000       DENY_WRITE 0x12019f    RDWR       NONE             /DATA/SMB/incoming   Special offers/SPECIAL OFFERS_2017.xls   Tue Aug  8 09:00:56 2017
15388        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   ПРОФОРМИ   Tue Aug  8 08:51:53 2017
15388        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   ПРОФОРМИ   Tue Aug  8 08:51:53 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   ПРОФОРМИ   Tue Aug  8 09:06:18 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   ПРОФОРМИ   Tue Aug  8 09:06:18 2017
15403        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Hotel all files/Summer 2017/Bansko   Tue Aug  8 09:27:07 2017
15403        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Hotel all files/Summer 2017/Bansko   Tue Aug  8 09:27:07 2017
15403        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Hotel all files/Summer 2017/Bansko/Murite club   Tue Aug  8 09:27:08 2017
15403        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Hotel all files/Summer 2017/Bansko/Murite club   Tue Aug  8 09:27:08 2017
15392        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Special offers   Tue Aug  8 09:00:18 2017
15392        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Special offers   Tue Aug  8 09:00:18 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Special offers   Tue Aug  8 09:06:18 2017
15385        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Special offers   Tue Aug  8 09:06:18 2017
15398        1000       DENY_NONE  0x100081    RDONLY     NONE             /DATA/SMB/incoming   Special offers   Tue Aug  8 09:17:41 2017
15403        1000       DENY_WRITE 0x120089    RDONLY     NONE             /DATA/SMB/incoming   Hotel all files/Summer 2017/Bansko/Murite club/All Inclusive Summer 2017.pdf   Tue Aug  8 09:27:12 2017

有问题的文件是:

Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
--------------------------------------------------------------------------------------------------
15392        1000       DENY_WRITE 0x12019f    RDWR       NONE             /DATA/SMB/incoming   Special offers/SPECIAL OFFERS_2017.xls   Tue Aug  8 09:00:56 2017

服务器上的当前时间是~9:30

除报告该问题的用户外,其他任何人都无法打开文件 /DATA/SMB/incoming/Special offers/SPECIAL OFFERS_2017.xls。

那里仅启动了一个 Microsoft Excel - 我试图解释这不是用户造成的问题。

相关内容