[Samba] Re: locks cooperating with a server side process

2004-07-20 Thread Chris Green
Chris Green [EMAIL PROTECTED] writes:

 I'm having a problem where I can gain the lock but the process is
 still writing to the file.

OK, I realized that putting python in might have scared away anyone
that knew C enough to help me out on my problem so I wrote a tiny
util to look at the fcntl based locks.

http://cmg.dok.org/code/lockview.c

As I copy the file from NT - Linux 2.4, There are no locks set on the
file. However, if I turn strict locking on, posix.c/is_posix_locked
will return true as soon as I gain the lock and abort the copy.

If just plain locking is on, the file will be deleted as soon as the
copy is complete if another process has gained a write lock.


Does anyone else use samba as a drop box for a unix process?

Is there anyway to make a file be locked upon creation with the copy
command?  I have a hard time figuring out all the paramters for
open_file_shared1

[2004/07/20 13:21:37, 5] smbd/files.c:file_new(123)
  allocated file structure 5634, fnum = 9730 (2 used)
[2004/07/20 13:21:37, 10] smbd/open.c:open_file_shared1(807)
  open_file_shared: fname = output/Testing/cygwin.tar, share_mode = 11, ofun = 10, 
mode = 660, oplock request
= 3


Thanks,
Chris
-- 
Chris Green [EMAIL PROTECTED]
Eschew obfuscation.

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Re: locks cooperating with a server side process

2004-07-20 Thread Adam Tauno WIlliams
  I'm having a problem where I can gain the lock but the process is
  still writing to the file.

If your building a 'drop box' so to speak, where a process picks up
files after they are copied in, perhaps you want to look into hooking
for application into 'fam'

http://oss.sgi.com/projects/fam/

man fam: 
...
   fam  is a server that tracks changes to the filesystem and
   relays these changes to interested applications.  Applica
   tions  such as fm(1G) and mailbox(1) present an up-to-date
   view of the filesystem.  In  the  absence  of  fam,  these
   applications  and  others like them are forced to poll the
   filesystem to detect changes.  fam is more efficient.
 
   Applications can request  fam  to  monitor  any  files  or
   directories  in  any filesystem.  When fam detects changes
   to monitored files, it notifies the  appropriate  applica
   tion.   The  FAM  API provides a programmatic interface to
   fam; see fam(3X).

   fam is informed of filesystem changes as  they  happen  by
   the  kernel through the imon(7M) pseudo device driver.  If
   asked to monitor files on an NFS mounted  filesystem,  fam
   tries  to  use fam on the NFS server to monitor files.  If
   fam cannot contact  a  remote  fam,  it  polls  the  files
   instead.  fam also polls special files.
...

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Re: locks cooperating with a server side process

2004-07-20 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Chris Green wrote:
...
| Does anyone else use samba as a drop box for a unix process?
|
| Is there anyway to make a file be locked upon creation with the copy
| command?  I have a hard time figuring out all the paramters for
| open_file_shared1
Chris,
This kind og question is probably better suited for
the samba-technical mailing list.  I would repost there.

cheers, jerry
- --
Hewlett-Packard- http://www.hp.com
SAMBA Team -- http://www.samba.org
GnuPG Key   http://www.plainjoe.org/gpg_public.asc
...a hundred billion castaways looking for a home. --- Sting
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFA/YEHIR7qMdg1EfYRArGLAJ9cDIX+qpu1jo3MDK8wt4CitjBn8wCePDzn
tNaMlQ4irMheC+EwD8vUAa8=
=IOzG
-END PGP SIGNATURE-
--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


[Samba] Re: locks cooperating with a server side process

2004-07-20 Thread Chris Green
Adam Tauno WIlliams [EMAIL PROTECTED] writes:

 If your building a 'drop box' so to speak, where a process picks up
 files after they are copied in, perhaps you want to look into hooking
 for application into 'fam'

 http://oss.sgi.com/projects/fam/


Thanks for the pointer.  My problem isn't picking up the file when
it's copied in, but picking it up when it's complete. Looking at the
imon ( and linux fcntl(2) ), there doesn't seem to be a way to say
let me know I'm the only person using this file short of mandatory
locking.

The work around for the users in my case is to copy the file, and
then rename but I'd really like it to be a one step operation.

Cheers,
Chris
-- 
Chris Green [EMAIL PROTECTED]
To err is human, to moo bovine.

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba


[Samba] Re: locks cooperating with a server side process

2004-07-20 Thread Chris Green
Gerald (Jerry) Carter [EMAIL PROTECTED] writes:

 This kind og question is probably better suited for
 the samba-technical mailing list.  I would repost there.

Ah thanks a bunch,
Chris
-- 
Chris Green [EMAIL PROTECTED]
Chicken's thinkin'

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba