Hi list, I have home made program, which uses File Alteration Monitor library to watch samba log files for new file creation in samba share directory. This technique works fine when I use GNU/Linux machine as client and it fails when I use Windows machine as client. The cause of failure is, samba server creates different pattern of logs and sometimes it does not create log entries on new file creation. New file creation is done by copying file to share directory after mounting it. Log configuration of samba server is log file = /var/log/samba/%U.log log level = 2 Below is log entries when GNU/Linux is used. [2007/03/20 18:01:18, 2] smbd/open.c:open_file(245) b2bc1ir opened file outbox/echoserver read=Yes write=Yes (numopen=1) [2007/03/20 18:01:18, 2] smbd/reply.c:reply_mknew(1324) new file outbox/echoserver [2007/03/20 18:01:18, 2] smbd/close.c:close_normal_file(270) b2bc1ir closed file outbox/echoserver (numopen=0) Below is log entries when Windows is used. [2007/03/25 21:48:53, 2] smbd/open.c:open_file(245) b2bc1ir opened file outbox/test.txt read=No write=Yes (numopen=2) [2007/03/25 21:48:53, 2] smbd/close.c:close_normal_file(270) b2bc1ir closed file outbox/test.txt (numopen=1) [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) [2007/03/25 21:48:54, 2] smbd/close.c:close_normal_file(270) b2bc1ir closed file outbox/test.txt (numopen=1) [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) [2007/03/25 22:00:07, 2] smbd/open.c:open_file(245) I use CentOS v4.4 and Samba version 3.0.10-1.4E.9 What could be wrong in my setup? Please advice, Thanks in advance, Bala ____________________________________________________________________________________ Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097
Hi, I trashed my stupid idea/program and wrote samba VFS module to do the same thing. It works very well.> I have home made program, which uses File Alteration Monitor library > to watch samba log files for new file creation in samba share > directory. > > This technique works fine when I use GNU/Linux machine as client and > it fails when I use Windows machine as client. The cause of failure > is, samba server creates different pattern of logs and sometimes it > does not create log entries on new file creation. > > New file creation is done by copying file to share directory after > mounting it. > > Log configuration of samba server is > log file = /var/log/samba/%U.log > log level = 2 > > Below is log entries when GNU/Linux is used. > > [2007/03/20 18:01:18, 2] smbd/open.c:open_file(245) > b2bc1ir opened file outbox/echoserver read=Yes write=Yes (numopen=1) > [2007/03/20 18:01:18, 2] smbd/reply.c:reply_mknew(1324) > new file outbox/echoserver > [2007/03/20 18:01:18, 2] smbd/close.c:close_normal_file(270) > b2bc1ir closed file outbox/echoserver (numopen=0) > > Below is log entries when Windows is used. > > [2007/03/25 21:48:53, 2] smbd/open.c:open_file(245) > b2bc1ir opened file outbox/test.txt read=No write=Yes (numopen=2) > [2007/03/25 21:48:53, 2] smbd/close.c:close_normal_file(270) > b2bc1ir closed file outbox/test.txt (numopen=1) > [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) > b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) > [2007/03/25 21:48:54, 2] smbd/close.c:close_normal_file(270) > b2bc1ir closed file outbox/test.txt (numopen=1) > [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) > b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) > [2007/03/25 22:00:07, 2] smbd/open.c:open_file(245) > > > I use CentOS v4.4 and Samba version 3.0.10-1.4E.9 > > What could be wrong in my setup? >Thanks, Bala __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Hi, It would be interesting see how you did it so if its not to much trouble share it here or on the samba wiki. cheers 2 maj 2007 kl. 04:22 skrev Bala:> > Hi, > > I trashed my stupid idea/program and wrote samba VFS module to do > the same thing. It works very well. > >> I have home made program, which uses File Alteration Monitor library >> to watch samba log files for new file creation in samba share >> directory. >> >> This technique works fine when I use GNU/Linux machine as client and >> it fails when I use Windows machine as client. The cause of failure >> is, samba server creates different pattern of logs and sometimes it >> does not create log entries on new file creation. >> >> New file creation is done by copying file to share directory after >> mounting it. >> >> Log configuration of samba server is >> log file = /var/log/samba/%U.log >> log level = 2 >> >> Below is log entries when GNU/Linux is used. >> >> [2007/03/20 18:01:18, 2] smbd/open.c:open_file(245) >> b2bc1ir opened file outbox/echoserver read=Yes write=Yes >> (numopen=1) >> [2007/03/20 18:01:18, 2] smbd/reply.c:reply_mknew(1324) >> new file outbox/echoserver >> [2007/03/20 18:01:18, 2] smbd/close.c:close_normal_file(270) >> b2bc1ir closed file outbox/echoserver (numopen=0) >> >> Below is log entries when Windows is used. >> >> [2007/03/25 21:48:53, 2] smbd/open.c:open_file(245) >> b2bc1ir opened file outbox/test.txt read=No write=Yes (numopen=2) >> [2007/03/25 21:48:53, 2] smbd/close.c:close_normal_file(270) >> b2bc1ir closed file outbox/test.txt (numopen=1) >> [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) >> b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) >> [2007/03/25 21:48:54, 2] smbd/close.c:close_normal_file(270) >> b2bc1ir closed file outbox/test.txt (numopen=1) >> [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) >> b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) >> [2007/03/25 22:00:07, 2] smbd/open.c:open_file(245) >> >> >> I use CentOS v4.4 and Samba version 3.0.10-1.4E.9 >> >> What could be wrong in my setup? >> > > > Thanks, > > Bala > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/listinfo/samba
Hi, Firstly I would like to say about the problem. Whenever new file is created by samba clients in samba directory shares, they should be moved to another directory. The solution is very straight forward. My VFS module keeps list of fds when a file is opened with write/read-write flag in open() vfs function. On close() vfs function, if passed fd is in list of fds made in open() function, is moved to well known directory. I started modifying skel_transparent.c file and kept only connect(), disconnect(), open() and close() functions. I hope this gives some clarity. Thanks, Regards, Bala --- Henrik Zagerholm <henke@mac.se> wrote:> Hi, > > It would be interesting see how you did it so if its not to much > trouble share it here or on the samba wiki. > > cheers > > 2 maj 2007 kl. 04:22 skrev Bala: > > > > > Hi, > > > > I trashed my stupid idea/program and wrote samba VFS module to do > > the same thing. It works very well. > > > >> I have home made program, which uses File Alteration Monitor library > >> to watch samba log files for new file creation in samba share > >> directory. > >> > >> This technique works fine when I use GNU/Linux machine as client and > >> it fails when I use Windows machine as client. The cause of failure > >> is, samba server creates different pattern of logs and sometimes it > >> does not create log entries on new file creation. > >> > >> New file creation is done by copying file to share directory after > >> mounting it. > >> > >> Log configuration of samba server is > >> log file = /var/log/samba/%U.log > >> log level = 2 > >> > >> Below is log entries when GNU/Linux is used. > >> > >> [2007/03/20 18:01:18, 2] smbd/open.c:open_file(245) > >> b2bc1ir opened file outbox/echoserver read=Yes write=Yes > >> (numopen=1) > >> [2007/03/20 18:01:18, 2] smbd/reply.c:reply_mknew(1324) > >> new file outbox/echoserver > >> [2007/03/20 18:01:18, 2] smbd/close.c:close_normal_file(270) > >> b2bc1ir closed file outbox/echoserver (numopen=0) > >> > >> Below is log entries when Windows is used. > >> > >> [2007/03/25 21:48:53, 2] smbd/open.c:open_file(245) > >> b2bc1ir opened file outbox/test.txt read=No write=Yes (numopen=2) > >> [2007/03/25 21:48:53, 2] smbd/close.c:close_normal_file(270) > >> b2bc1ir closed file outbox/test.txt (numopen=1) > >> [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) > >> b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) > >> [2007/03/25 21:48:54, 2] smbd/close.c:close_normal_file(270) > >> b2bc1ir closed file outbox/test.txt (numopen=1) > >> [2007/03/25 21:48:54, 2] smbd/open.c:open_file(245) > >> b2bc1ir opened file outbox/test.txt read=Yes write=No (numopen=2) > >> [2007/03/25 22:00:07, 2] smbd/open.c:open_file(245) > >> > >> > >> I use CentOS v4.4 and Samba version 3.0.10-1.4E.9 > >> > >> What could be wrong in my setup? > >> > > > > > > Thanks, > > > > Bala > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > -- > > To unsubscribe from this list go to the following URL and read the > > instructions: https://lists.samba.org/mailman/listinfo/samba > >__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com