Operating System - HP-UX
1752806 Members
6651 Online
108789 Solutions
New Discussion юеВ

Re: Samba and File Change Notification

 
SOLVED
Go to solution
Luis Toro
Regular Advisor

Samba and File Change Notification

We are doing a proof of concept on a process whereby files are generated by a UNIX application, then a Windows app picks up the file, processes it, then deletes it. Since this had to be done realtime (ie., ftp was not an option), we're using samba to mount the UNIX directory on the Windows server. Here's what we're noticing: when a single file is created on the share, the windows process picks it up immediately. When multiple files are created, there is a substantial delay (20-30 seconds). When multiple files are created, and someone goes in to delete a file, the process picks everything up immediately. The developer of the Windows process mentioned that his process waits on a "file change notification" on the windows side. I administer the UNIX server, and we only use Samba on a handful of servers, and thats for windows users to access reports. Any info on this would be appreciated.
Thanks
10 REPLIES 10
RAC_1
Honored Contributor

Re: Samba and File Change Notification

I think you need to refresh the share every few secs. How do you do it?? May be through the script that you use to pick up files.

Anil
There is no substitute to HARDWORK
Luis Toro
Regular Advisor

Re: Samba and File Change Notification

I don't think its a script on the windows side. Looks like its a program which monitors a windows system event called "file change notification", making the process realtime. Seems to work when a single file is placed on the UNIX directory. But with multiple files, there is a delay.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Samba and File Change Notification

This link looks like it could be your problem:

http://lists.samba.org/archive/samba-technical/2003-January/026557.html

Pay attention to this section:

Samba should send
back a list of such file/action records with one record for
each file action that triggered the notification, up to the
maximum as determined by the parameter count field in the
request. If the number of records would be greater that the
max allowed, the samba server should return a
STATUS_NOTIFY_ENUM_DIR error.
If it ain't broke, I can fix that.
Luis Toro
Regular Advisor

Re: Samba and File Change Notification

Thanks Clay.

That seems to describe my dilemma. Does this mean that someone would have to "hack" the samba code to get it to issue these records on a per file basis ? I have the HP-provided samba on this system.
TwoProc
Honored Contributor

Re: Samba and File Change Notification

OK Luis,

Just maybe to try a change in tactic... If the number of Windows computers hooked to this thing is small (I'll say you're probably doing a Windows Server based solution - so maybe only one server is the client to the HP host).
IF this is true. why don't you try an NFS mount onto the HP server?
Reflections NFS is very good, and very inexpensive ($400) or so. If you need cheaper - (like free) try the cygwin utilities (search google for "cygwin" for the place to download it). I've used quite a few of the Cygwin tools, (though not an NFS client) and they are great.

I'd think that you may yet have a shot at making this work if give NFS a try. At least you can have the answer very quickly!
We are the people our parents warned us about --Jimmy Buffett
Luis Toro
Regular Advisor

Re: Samba and File Change Notification

John,
NFS was an option. But from what I've read (in this forum), seemed like CIFS was the preferred method to mount a UNIX directory as a network share on a windows server. Samba also provided a bit granularity on the security via the usermap and smb.conf file. BTW: This only involves one UNIX and one windows server.
I forwarded all this to the windows developer to see who he wants to go forward.
Steven E. Protter
Exalted Contributor

Re: Samba and File Change Notification

I think What A. Clay has done is to point out the Samba bug.

Can you tell me what version of Samba/CIFS is installed. The latest and greatest might resolve the issue.

swlist -l product | grep -i samba

or

swlist -l product | grep -i cifs

Can't remember which will provide the version number.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Luis Toro
Regular Advisor

Re: Samba and File Change Notification


A.01.11.03
TwoProc
Honored Contributor

Re: Samba and File Change Notification

Luis - I agree that Samba is probably more robust. However, I know that NFS is pretty quick for this kind of activity (but not necessarily large file transfers), and my recommendation was for you if you were basically stuck. That being said - it looks like the bug has been identified and will yield results.
We are the people our parents warned us about --Jimmy Buffett