Re: writeprotection of unmounted mountpoints automaitcally - possible??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2005-01-19 at 12:20 +0100, Alexander Raab wrote:
> Paul Howarth wrote:
> 
> >On Mon, 2005-01-17 at 22:37 +0100, Alexander Raab wrote:
> >  
> >
> >>Yes, I am running this as root. It's an automatical-backup. Sometimes I 
> >>need the disk at an other place. So the backup runs into the directory 
> >>not at the disk.
> >>    
> >>
> >
> >Presumably this automated backup is running out of a script? If so, why
> >not just put a test at the start of the script to check if the drive is
> >mounted?
> >
> >Paul.
> >  
> >
> Sure, thats a workaround.
> I was looking for a solution of the whole problem.
> 

That is NOT a workaround.  That IS a solution.  It uses programming
logic to decide what action to take, and those 'tricks' are used in MANY
programs to make sure the required conditions are met before doing
something.

A commonly used program named passwd goes even further.  It checks the
user id and if not root it will only allow the user to change their own
password.  If root it allows the user to change any users password.

When you write a script/program/procedure you must define the conditions
that are required for satisfactory execution and also the actions to
take if those conditions are not met.  Any of the scripts
in /etc/rc.d/init.d use similar logic to function.
Check /etc/rc.d/init.d/network and you will see what I mean.

In your case, since you do NOT want the script to execute unless the
device is mounted, the suggestions you have received of how to check if
it is mounted are parameters of the condition required to be met before
it can complete and becomes the (automated) solution to your problem,
not a workaround.

> thanks,
> Alex
> 


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux