FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Install

 
 
LinkBack Thread Tools
 
Old 11-28-2007, 04:27 PM
"Waldher, Travis R"
 
Default NFS File Locking

Is there a command I can use to manually lock a file?


*


My goal is to test NFS file locking with groups greater than
16.







_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@redhat.com
Subject: unsubscribe
 
Old 11-28-2007, 06:08 PM
Rick Stevens
 
Default NFS File Locking

On Wed, 2007-11-28 at 09:27 -0800, Waldher, Travis R wrote:
> Is there a command I can use to manually lock a file?
>
>
>
> My goal is to test NFS file locking with groups greater than 16.

I don't know of one, but it wouldn't be hard to write. You'd need to
open the file, lock it via fcntl() (flock() does not work over NFS) and
hold the lock until not needed.

Remember that if the program exits, the lock would be released.

----------------------------------------------------------------------
- Rick Stevens, Principal Engineer rstevens@internap.com -
- CDN Systems, Internap, Inc. http://www.internap.com -
- -
- Make it idiot proof and someone will make a better idiot. -
----------------------------------------------------------------------

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@redhat.com
Subject: unsubscribe
 
Old 11-29-2007, 12:19 AM
"Karl Pearson"
 
Default NFS File Locking

On Wed, November 28, 2007 12:08 pm, Rick Stevens wrote:
> On Wed, 2007-11-28 at 09:27 -0800, Waldher, Travis R wrote:
>> Is there a command I can use to manually lock a file?
>>
>>
>>
>> My goal is to test NFS file locking with groups greater than 16.
>
> I don't know of one, but it wouldn't be hard to write. You'd need to
> open the file, lock it via fcntl() (flock() does not work over NFS) and
> hold the lock until not needed.
>
> Remember that if the program exits, the lock would be released.

Can't you just emacs or vi the file and accomplish the same thing? Just a
thought to save something or other.

Karl

>
> ----------------------------------------------------------------------
> - Rick Stevens, Principal Engineer rstevens@internap.com -
> - CDN Systems, Internap, Inc. http://www.internap.com -
> - -
> - Make it idiot proof and someone will make a better idiot. -
> ----------------------------------------------------------------------
>
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list@redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request@redhat.com
> Subject: unsubscribe
>


--
Karl L. Pearson
karlp@ourldsfamily.com
http://consulting.ourldsfamily.com
---
My Thoughts on Terrorism In America right after 9/11/2001:
http://www.ourldsfamily.com/wtc.shtml
---
The world is a dangerous place to live... not because of
the people who are evil, but because of the people who
don't do anything about it.
- Albert Einstein
---
"To mess up your Linux PC, you have to really work at it;
to mess up a microsoft PC you just have to work on it."
---

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@redhat.com
Subject: unsubscribe
 
Old 11-29-2007, 01:26 AM
Rick Stevens
 
Default NFS File Locking

On Wed, 2007-11-28 at 18:19 -0700, Karl Pearson wrote:
> On Wed, November 28, 2007 12:08 pm, Rick Stevens wrote:
> > On Wed, 2007-11-28 at 09:27 -0800, Waldher, Travis R wrote:
> >> Is there a command I can use to manually lock a file?
> >>
> >>
> >>
> >> My goal is to test NFS file locking with groups greater than 16.
> >
> > I don't know of one, but it wouldn't be hard to write. You'd need to
> > open the file, lock it via fcntl() (flock() does not work over NFS) and
> > hold the lock until not needed.
> >
> > Remember that if the program exits, the lock would be released.
>
> Can't you just emacs or vi the file and accomplish the same thing? Just a
> thought to save something or other.

I'm not 100% sure of that. Typically an editor doesn't take a write
lock on a file. Rather, the editor makes a work copy of the file which
you edit (which is why editing a large file in vi takes so long to
start...it's making a copy of the file). Some editors actually just
keep a record of what you did. If you "quit and discard changes", the
work file or the log of what you did are simply discarded and the
original file is left alone.

When you "exit and save", the old file gets overwritten by the work file
or the edits get played back to modify the file. So, the only time a
write lock is made on the file is when you commit the edits.

----------------------------------------------------------------------
- Rick Stevens, Principal Engineer rstevens@internap.com -
- CDN Systems, Internap, Inc. http://www.internap.com -
- -
- Have you noticed that "human readable" configuration file -
- directives are beginning to resemble COBOL code? -
----------------------------------------------------------------------

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@redhat.com
Subject: unsubscribe
 
Old 11-29-2007, 02:05 AM
"Karl Pearson"
 
Default NFS File Locking

On Wed, November 28, 2007 7:26 pm, Rick Stevens wrote:
> On Wed, 2007-11-28 at 18:19 -0700, Karl Pearson wrote:
>> On Wed, November 28, 2007 12:08 pm, Rick Stevens wrote:
>> > On Wed, 2007-11-28 at 09:27 -0800, Waldher, Travis R wrote:
>> >> Is there a command I can use to manually lock a file?
>> >>
>> >>
>> >>
>> >> My goal is to test NFS file locking with groups greater than 16.
>> >
>> > I don't know of one, but it wouldn't be hard to write. You'd need to
>> > open the file, lock it via fcntl() (flock() does not work over NFS) and
>> > hold the lock until not needed.
>> >
>> > Remember that if the program exits, the lock would be released.
>>
>> Can't you just emacs or vi the file and accomplish the same thing? Just a
>> thought to save something or other.
>
> I'm not 100% sure of that. Typically an editor doesn't take a write
> lock on a file. Rather, the editor makes a work copy of the file which
> you edit (which is why editing a large file in vi takes so long to
> start...it's making a copy of the file). Some editors actually just
> keep a record of what you did. If you "quit and discard changes", the
> work file or the log of what you did are simply discarded and the
> original file is left alone.
>
> When you "exit and save", the old file gets overwritten by the work file
> or the edits get played back to modify the file. So, the only time a
> write lock is made on the file is when you commit the edits.

I believe you. So, what of something like XV or GIMP then? They make an
exclusive lock against the file, don't they?

Karl

>
> ----------------------------------------------------------------------
> - Rick Stevens, Principal Engineer rstevens@internap.com -
> - CDN Systems, Internap, Inc. http://www.internap.com -
> - -
> - Have you noticed that "human readable" configuration file -
> - directives are beginning to resemble COBOL code? -
> ----------------------------------------------------------------------
>
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list@redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request@redhat.com
> Subject: unsubscribe
>


--
Karl L. Pearson
karlp@ourldsfamily.com
http://consulting.ourldsfamily.com
---
My Thoughts on Terrorism In America right after 9/11/2001:
http://www.ourldsfamily.com/wtc.shtml
---
The world is a dangerous place to live... not because of
the people who are evil, but because of the people who
don't do anything about it.
- Albert Einstein
---
"To mess up your Linux PC, you have to really work at it;
to mess up a microsoft PC you just have to work on it."
---

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@redhat.com
Subject: unsubscribe
 
Old 11-29-2007, 05:57 PM
Rick Stevens
 
Default NFS File Locking

On Wed, 2007-11-28 at 20:05 -0700, Karl Pearson wrote:
> On Wed, November 28, 2007 7:26 pm, Rick Stevens wrote:
> > On Wed, 2007-11-28 at 18:19 -0700, Karl Pearson wrote:
> >> On Wed, November 28, 2007 12:08 pm, Rick Stevens wrote:
> >> > On Wed, 2007-11-28 at 09:27 -0800, Waldher, Travis R wrote:
> >> >> Is there a command I can use to manually lock a file?
> >> >>
> >> >>
> >> >>
> >> >> My goal is to test NFS file locking with groups greater than 16.
> >> >
> >> > I don't know of one, but it wouldn't be hard to write. You'd need to
> >> > open the file, lock it via fcntl() (flock() does not work over NFS) and
> >> > hold the lock until not needed.
> >> >
> >> > Remember that if the program exits, the lock would be released.
> >>
> >> Can't you just emacs or vi the file and accomplish the same thing? Just a
> >> thought to save something or other.
> >
> > I'm not 100% sure of that. Typically an editor doesn't take a write
> > lock on a file. Rather, the editor makes a work copy of the file which
> > you edit (which is why editing a large file in vi takes so long to
> > start...it's making a copy of the file). Some editors actually just
> > keep a record of what you did. If you "quit and discard changes", the
> > work file or the log of what you did are simply discarded and the
> > original file is left alone.
> >
> > When you "exit and save", the old file gets overwritten by the work file
> > or the edits get played back to modify the file. So, the only time a
> > write lock is made on the file is when you commit the edits.
>
> I believe you. So, what of something like XV or GIMP then? They make an
> exclusive lock against the file, don't they?

I don't know. I've never straced those apps. You could do that and see
what they do. Watch for "fcntl(fd, F_SETLK, pointer-to-struct-flock)"
calls.

If you need an app written to do it, I can probably crank some
comamnd-line thing out in an hour or two, e.g.

$setalock [-w] /path/to/file

If you specify "-w", it'd set a write lock on the file. Default would
be a read lock. It'd hold it until you CTRL-C the program.

----------------------------------------------------------------------
- Rick Stevens, Principal Engineer rstevens@internap.com -
- CDN Systems, Internap, Inc. http://www.internap.com -
- -
- Consciousness: that annoying time between naps. -
----------------------------------------------------------------------

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@redhat.com
Subject: unsubscribe
 
Old 11-30-2007, 01:57 AM
Cameron Simpson
 
Default NFS File Locking

On 28Nov2007 20:05, Karl Pearson <karlp@ourldsfamily.com> wrote:
| I believe you. So, what of something like XV or GIMP then? They make an
| exclusive lock against the file, don't they?

I'm pretty sure XV doesn't lock the file. Like Rick, I've never traced
it but I'm pretty sure I've used XV to view updates to an image while I
changed it with another program.

It's mostly only on Windows that most apps offend by locking all their data
files by default.
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@redhat.com
Subject: unsubscribe
 

Thread Tools




All times are GMT. The time now is 04:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org