[Samba] IIS Change Notifications

Gareth Evans agrath at gmail.com
Thu Jan 13 19:16:33 MST 2011


As per previous message, I thought it might be the size of the path or
something, so I just set up another fresh 10.10 ubuntu, built 3.5.6 from
source and tested with changenotify exe using a short path
(\\smbtest\tmp<file://smbtest/tmp>
)
This is on a different win7 box to the one I was using last time, which
eliminates any potentially strange configs on that machine.
Also a fresh 10.10 so nothing odd could be there that could be breaking this
from my testing last time
Just installed the box, aptitude update && aptitude upgrade, wget source,
./configure, make, makeinstall
Created nobody user, copied smb.conf, started the server up

And then started testing...Definitely still isn't working for me. (on
moves/copies/modifies)

Here's my share config from my original tests:
[tmp]
        comment = IIS Webstore
        browseable = yes
        path = /smbtemp
        force user = smb-mwhdata
        force group = smb-mwhdata
        create mask = 0640
        directory mask = 0750
        guest ok = yes
        guest account = smb-mwhdata
        writable = yes
        locking = no (I also tried with locking=yes)

I have edited it down to this for testing to make sure it's not something in
the config (e.g. force-user or the masks)
[tmp]
        comment = IIS Webstore
        browseable = yes
        path = /smbtemp
        guest ok = yes
        guest account = nobody
        writable = yes

Just finished testing - I've recorded a screen capture.

SMBD is in interactive mode in one ssh session (on the right)
Bottom left has a windows file browser
Middle left is my ssh session where i'm making changes to the files
Top left is the changenotification logging application

You can download the screen capture here:
It's an AVI and has been encoded with xvid for the video, there's no audio
track.
http://agrath.mole.feralhosting.com/samba-xvid.avi (49mb)

Sorry, I didn't save the log or capture the samba traffic from this testing-
just trying to show you that things aren't working quite right
You can see that when I do cp/mv commands over existing files (works with
new ones) that the changes don't show up
Or when I modify a file on the console (e.g. with nano) that nothing gets
sent to say the file changed

Right at the end I started a editpad/editor program and was going to change
the file on windows side but I didn't have write permission so I just
stopped recording

Gareth
On Fri, Jan 14, 2011 at 10:11 AM, Gareth Evans <agrath at gmail.com> wrote:

> sorry, accidentally hit reply instead of reply all
>
>
>  On Fri, Jan 14, 2011 at 10:05 AM, Gareth Evans <agrath at gmail.com> wrote:
>
>>  Okay I guess the recursive thing makes sense, I hope IIS establishes
>> watches on the specific directories it's interested in.
>> The tree could indeed be very deep.
>> I guess the only way to know is to test with it once I can repeat the same
>> operations as you and get the same output.
>>
>> I don't know what i'm doing differently, but it certainly didn't detect
>> the move/copy/modify operations when I tested it.
>> Would the local server filesystem make a difference? I doubt it, but worth
>> asking
>>
>> There has to be something different between our two tests, there can't be
>> anything I'm doing wrong specifically that causes it to not work, it's a
>> pretty simple test.
>> I was definitely making the changes in the directory that I had the
>> notify/watch established for
>>
>> Do you see the 'client only requested 32 bytes marshalling 58 (?) bytes'
>> message in your log output? I always saw that error when I was testing and
>> it didn't work.
>> From reading the source, that error is generated immediately before a
>> return false from the notify response.
>> How long is your UNC path? Mine was a reasonable length:
>> That's 52 bytes by itself, plus a filename could be where that ~58 bytes
>> number came from
>> \\smbtest\mwh-webstore\clientname\site.co.nz\htdocs
>>
>> I think that if I triggered the changes from a samba share that it was
>> handled correctly, but the changes on the shell didn't.
>> I'd need to test this specific scenario to confirm if this was the case.
>>
>> In our scenario, our FTP servers are modifying files via a mounted NFS
>> share, or things are changed directly on the console (e.g. unzipping an
>> archive of site files)
>>
>> I'm at the office right now, and my test ubuntu server with 3.5.6 is on it
>> is at home - I can go there if you need more testing info or want me to try
>> specific scenarios.
>>
>>
>> Gareth
>>
>>
>> On Fri, Jan 14, 2011 at 9:55 AM, Volker Lendecke <
>> Volker.Lendecke at sernet.de> wrote:
>>
>>> On Fri, Jan 14, 2011 at 09:39:13AM +1300, Gareth Evans wrote:
>>> > Looks like you're using a mapped drive letter rather than a UNC path
>>> -that
>>> > could be contributing.
>>>
>>> Yes. Just tried with a UNC path. Same result.
>>>
>>> > It sounds like what you're doing to test is fairly equivilent to what I
>>> was
>>> > doing but in this case, i'm seeing what I would have expected to see in
>>> my
>>> > testing.
>>> >
>>> > What OS is your client machine? XP? Win7?
>>>
>>> Win7 for this test.
>>>
>>> > If a smb client requests a recursive watch, such as IIS would (because
>>> it
>>> > would register the notify on the root folder and expect to be told if
>>> > something in bin subfolder changes) does samba register notifications
>>> in a
>>> > recursive way (i.e. subfolders)
>>>
>>> It does internally. This means that we get recursive change
>>> notifies that are triggered via other CIFS clients.
>>>
>>> For example the
>>>
>>> File: z:\mput\file00000168.exe Deleted
>>>
>>> from my last message was triggered by smbclient connected to
>>> the same share. Doing a "rm /data/tmp/mput/xxx" on the Linux
>>> server shell would not have triggered it.
>>>
>>> We do not get recursive changes triggered by local Unix
>>> clients. Given the non-recursive nature of the inotify API,
>>> his would be potentially prohibitively expensive. We might
>>> have to walk a directory tree arbitrarily large.
>>>
>>> With best regards,
>>>
>>> Volker Lendecke
>>>
>>> --
>>> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
>>> phone: +49-551-370000-0, fax: +49-551-370000-9
>>> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
>>>
>>
>>
>


More information about the samba mailing list