Jason Haar
2008-May-27 02:08 UTC
[Samba] how to get Windows to notice unix-based delete command (inotify)
Hi there We have a Samba-based "upload server" where people put files to be processed. Anyway, when they upload files, a Unix-based script runs and moves the files off. However, the Windows explorer app doesn't "notice" the removal, and the user still sees the files. If they F5/refresh explorer, the files indeed have disappeared. If I have two explorer windows open from two different Windows hosts on the same Samba dir, and create a file on one, it shows up within 1-2 seconds on the other - which is good. Obviously this is an inotify/dnotify issue, so I guess my question is, how can I change the Unix script so that Samba is able to "tell" the connected client that a file change has occurred, so that it refreshes the content? This is under CentOS-4.6 with Samba-3.0.28a/3.0.29, and "kernel change notify = Yes" Thanks! -- Cheers Jason Haar Information Security Manager, Trimble Navigation Ltd. Phone: +64 3 9635 377 Fax: +64 3 9635 417 PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1
Jeremy Allison
2008-May-27 03:56 UTC
[Samba] how to get Windows to notice unix-based delete command (inotify)
On Tue, May 27, 2008 at 02:01:38PM +1200, Jason Haar wrote:> Hi there > > We have a Samba-based "upload server" where people put files to be > processed. Anyway, when they upload files, a Unix-based script runs and > moves the files off. However, the Windows explorer app doesn't "notice" > the removal, and the user still sees the files. If they F5/refresh > explorer, the files indeed have disappeared. If I have two explorer > windows open from two different Windows hosts on the same Samba dir, and > create a file on one, it shows up within 1-2 seconds on the other - > which is good. > > Obviously this is an inotify/dnotify issue, so I guess my question is, > how can I change the Unix script so that Samba is able to "tell" the > connected client that a file change has occurred, so that it refreshes > the content? > > This is under CentOS-4.6 with Samba-3.0.28a/3.0.29, and "kernel change > notify = Yes"With kernel based dnotify you shouldn't have to do anything, the smbd should get signalled once the file is gone causing it to notify the client. Unfortunately there's no debug messages in the kernel inotify handler (that's an oversight, I'll add one once I'm back at work tomorrow). Can you add one (in the function inotify_handler() in smbd/notify_inotify.c and see if it gets triggered appropriately ? Jeremy.
Maybe Matching Threads
- fam inconsistent in noticing changes
- Vista SP1-rc1 appears to break against Samba-3.0.27a
- Cannot connect to Samba-3.0.23d (and earlier) from other trusted AD domains
- Samba crashes & floods logfiles: "smbd/notify_inotify.c:244(inotify_handler) - No data on inotify fd?!"
- "inotify_handler No data on inotify fd?"