LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-14-2011, 01:25 AM   #1
pdi
Member
 
Registered: May 2008
Posts: 50

Rep: Reputation: 59
Terminal server and file locking


Hi all,

I am examining the workings of a terminal server and have come up to a dead end.

The setup is a central PC with XDMCP getting connections from two peripheral PCs. All PCs have normal Slackware installations (12.0 the central one, 13.1 the others). XDMCP works fine and the users login to KDE. The users have a common directory with appropriate permissions for group work.

The problem is file locking. More than one users can open and work on the same file in the common directory, eg. foto editing the same jpg with GIMP.

Googling around I found that file locking is advisory in Linux, meaning its up to the applications to honour it. Also that there is a mand (mandatory locking) mount option which seems like the solution, but there are warnings [1], [2]. Other finds point to the use of versioning systems (svn, git) to take care of file locking, or network file systems (cifs, nfs): I'd prefer not to burden casual users with having to come to terms with a versioning system, and the network file systems seem wrong since the users work locally.

Considering Linux is a multiuser OS I am taken aback from this apparent lack of file locking support and tend to think I'm missing something obvious.

Has anyone experienced/solved a similar setup? Any words of advice? Many thanks in advance.

A couple of last points. The common directory is on a normal mount (ext3, RAID1), fstab entry:
Code:
/dev/md0         /data            ext3        defaults         1   2
And I'm aware of options like TSLP, but I'd rather resolve the issue generically.



[1] man fcntl(2) says "The Linux implementation of mandatory locking is unreliable."
[2] http://www.mjmwired.net/kernel/Docum...ry-locking.txt
 
Old 04-14-2011, 04:10 AM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by pdi View Post
Considering Linux is a multiuser OS I am taken aback from this apparent lack of file locking support and tend to think I'm missing something obvious.
No, you aren't. Linux's behavior is consistent with its Unix roots.

You can perhaps use standard file permissions to "lock out" other users from accessing/modifying it once someone has acquired the lock. That would probably require a special script/executable.
 
Old 04-14-2011, 06:29 AM   #3
pdi
Member
 
Registered: May 2008
Posts: 50

Original Poster
Rep: Reputation: 59
Unhappy

So Richard, if I understand you right, I'd have to devise a script which will do the file locking? Recursively for all files in a given dir, intervening in the file open of all applications? Is it really that complex?
 
Old 04-14-2011, 07:10 AM   #4
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by pdi View Post
So Richard, if I understand you right, I'd have to devise a script which will do the file locking? Recursively for all files in a given dir, intervening in the file open of all applications? Is it really that complex?
Well, you aren't going to be able to get a script to intervene in the file open of all applications.

You can have a script that your users can invoke to give themselves exclusive rights to a given set of files. Or run your stuff under windows, where NTFS provides the file system semantics that appear to match what you expect. (I don't know if the linux implementation of NTFS does the same.)
 
Old 04-15-2011, 11:49 PM   #5
pdi
Member
 
Registered: May 2008
Posts: 50

Original Poster
Rep: Reputation: 59
Thank you for your input. I'd rather stay away from windows and am still rather bemused by all this. I guess I'm in for a long set of trials and errors.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Locking the screen from login terminal linux_evangelist Linux - Newbie 1 12-29-2010 03:26 PM
File Locking linuxaddict7 Linux - Software 6 06-11-2009 10:03 AM
Terminal Server and file sharing gejr Linux - Networking 1 02-26-2007 10:07 AM
locking a usage policy file/ftp file permissions gbow Linux - Newbie 0 02-16-2004 05:35 AM
File locking over Samba rtaft Linux - Software 0 12-30-2003 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration