LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-30-2006, 11:03 AM   #1
aherrys
Member
 
Registered: Jul 2003
Posts: 85

Rep: Reputation: 15
logout/exit script ??


Dear All,

I have a problem that I hope you guys can help by giving some suggestions.

I have a machine that is shared among several people. And I have setup a directory in there that is shared among all the users. This directory because of some reasons has to be also viewable from window OS that is dual booted off the same machine.
So I have that directory actually a mount directory of a vfat partition.

On the fstab I have put the entry of that partition (/dev/sda5) to be like this:

/dev/sda5 /mnt/data vfat noauto,user,rw 1 0

so any user that login to the machine then can mount the partition and have the /mnt/data under his/her name and have full read/write access to it.

But problem is sometimes these people forget to unmount the directory after they have finished and logout of the system. And the next guy wouldn't be able to umount or mount the directory again or to write to it.

So one of the solution I can think of is to have a simple script to automatically unmount the partition everytime the user logout. So something like a logout or exit script (a counterpart of the profile script).

Is there such a thing as a logout script in linux ? Or do you have some other solutions for my problems ?


Thanks a million for any help or suggestion
 
Old 12-30-2006, 11:14 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Easier might be to have that partition mounted at boot time, in such a way that all the files are owned by root, but have permissions of 777 (ie anyone can read/write these files).
So try this as your fstab line:
/dev/sda5 /mnt/data vfat iocharset=iso8859-15,codepage=850,umask=0 0 0
then either reboot or do mount -a as root
 
Old 12-30-2006, 11:18 AM   #3
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Why don't you mount it automatically at startup and just keep it mounted? If you specify the options gid (to give all files on the mounted partition your users group) and a corresponding umask, it should work for everybody. Here's mine:
Code:
/dev/hda3     /mnt/win      vfat     gid=users,umask=002      0  0
 
Old 12-30-2006, 11:42 AM   #4
aherrys
Member
 
Registered: Jul 2003
Posts: 85

Original Poster
Rep: Reputation: 15
You know what.... I learned something new today...

Thanks guys... both suggestions obviously work, but I will stick to one given by uselpa, since it is more secure by not giving the world access to the mounted directory.

Thanks again...
 
  


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
10.0 RC1 logout out from KDE needs CTRL-Z to exit 1kyle SUSE / openSUSE 0 09-23-2005 04:01 AM
call another script and have the inital script exit mjtice Programming 1 09-11-2005 11:54 AM
Invoke script on xsession exit? comp12345 Linux - Software 1 06-27-2004 10:27 PM
RHL9.0 hangs when logout/exit command line mellsie25 Linux - Newbie 7 10-17-2003 09:30 PM
script 'exit' command kilobravo Linux - General 8 01-16-2003 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:34 PM.

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