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

Re: Mounting NFS drives only when docked



Here's what comes to mind for me:

Use ping as a test to see if you nfs mounts are
available. Here is the man info relevant-

*****************************************************
If ping does not receive any reply packets at all it
will exit with code 1.  On error it exits with code 2.
Otherwise it exits with code 0. This makes it possible
to use the exit code to see if a host is alive or not.
*****************************************************

So you could do:

if ping -c 3 NFS_SERVERNAME_OR_ADDRESS
  ' do the nfs mounts
fi

I just picked 3 pings as a good test (-c is how many
pings).

You could put this in a script that runs from
rc.local, or something like that. OK, now everybody
show the right way to do it!





--- fiaid@quasi-sane.com wrote:

> Do you have differing ethernet interfaces when the
> system is docked?  If 
> so, it shuldn't be that hard to whip something up
> that will look and see 
> what is up and then take the appropriate action.
> 
> > Does anybody have any good utility or algorithm
> suggestions for setting
> > up automatic NFS mounts from my server to my
> laptop whenever I boot it
> > up in its home docking station?
> > 
> > What I want is to have my cake and eat it too.
> I've moved and
> > reorganized more than 100G of stuff off my 48G and
> 80G laptop drives
> > onto the new server (where it's safe!). I don't
> want to maintain copies
> > of that much stuff on the laptop. Besides, once in
> a while I'd like to
> > use the DVD/CD-RW drive in the expansion bay the
> second hard drive has
> > been living in. I think I will replicate on my
> laptop the directory
> > structure now in /pub on my server, then use NFS
> to mount them back on
> > the laptop.
> > 
> > I could edit /etc/fstab and do this brute force.
> But I think I'll always
> > face the choice between manually and automounting
> them. If I manually
> > mount them in dock, then I won't have to wait for
> a couple of dozen NFS
> > mounts to fail when not docked?
> > 
> > Is there a better way?
> > 
> > --Doc
> > 
> > 
> > -
> > To unsubscribe, send email to majordomo@silug.org
> with
> > "unsubscribe silug-discuss" in the body.
> > 
> 
> -- 
> Tighe Schlottog         workape         fiaid
> "Nothing is too cruel if it is funny enough."
> 
> 
> -
> To unsubscribe, send email to majordomo@silug.org
> with
> "unsubscribe silug-discuss" in the body.
> 


=====
Faith without Works is Dead...

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.