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

Re: debian startup scripts & dedicated ppp



> You should propagate the PPP startup script before the NFS
> mounts occur.  This is a site specific configuration that
> probably isn't that common.  Never the less, I think Debian
> 1.2 will probably deal with this better (I think).  In the

I hope so. I didn't have much trouble getting the nfs stuff working, but
I didn't like what I had to do and I felt it should work better out of the
box without requiring editing of the rc scripts.

> system in front of me right now (mine's floating in the
> Pacific at the moment :-)), so this is the best I can do.
> This should get your ppp up prior to going to the mount
> phase.

Are you the guy who's doing data collection with a underwater linux
system? I think that'd make a great Linux Journal article :-)
 
> This seems to be a very popular problem.  Debian, RedHat,
> Slackware, SunOS, Solaris, Irix all kill all processes prior
> to unmounting filesystems.  The theory behind this is that
> if a filehandle is open on a filesystem, it can't be
> unmounted.  The problem is when the process killed is ypbind
> or pppd and you can't resolve the hostname of the NFS
> server.  

I did like redhat's solution; it worked for me, but I can think of
situations where it wouldn't..
 
> I think Solaris 2.5+ has a functional fuser command
> that could be used to kill all processes (close all open
> filehandles) on a mount point.  The shutdown procedure could
> then kill processes on NFS mounted filesystems first,
> unmount NFS filesystems, then do its normal routine of
> killing all processes and umounting all filesystems.
> 
> Anybody know if Debian's fuser command supports this?
> Anybody got any other ideas here?

It looks like fuser will support this, it has a -k flag that will kill all
processes accessing a file. fuser -m -k /home should kill every process
using the /home partition.

> > I see that red hat uses a "nfsfs" script that's responsible for
> > starting/stopping nfs services at the appropriate time. Unless I'm just
> > totally missing something with my problems as I described them above, I
> > propose that a similar script be added to debian. 
> 
> How does this script handle the open filehandles issue on

It doesn't handle them at all. The key thing is, it's a standard sysv init
script, so the sysadmin can change the order it's executed in my changing
the symlink, and so can ensure that anything else that's using the nfs
mounts gets killed before the script is executed. (In theory, anyway.)

> Do you have a copy of the script?

Here's a copy of the script:

#!/bin/sh
#
# nfsfs         Mount NFS filesystems.
#
# Version:      @(#) /etc/init.d/skeleton 1.01 26-Oct-1993
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# See how we were called.
case "$1" in
  start)
        echo -n "Mounting remote filesystems."
        mount -a -t nfs
        touch /var/lock/subsys/nfsfs
        echo
        ;;
  stop)
        echo -n "Unmounting remote filesystems."
        umount -a -t nfs
        rm -f /var/lock/subsys/nfsfs
        echo
        ;;
  *)
        echo "Usage: nfsfs {start|stop}"
        exit 1
esac

exit 0


-- 
#!/usr/bin/perl -lisubstr($_,39+38*sin++$y/9,2)=$s # jeh22@cornell.edu
for($s='  '||McQ;$_='JOEY HESS 'x8;print){eval$^I} #         Joey Hess
                      "He. He. He." - - Herman Toothrot



Reply to: