[1760] in SIPB_Linux_Development

home help back first fref pref prev next nref lref last post

Shutting down afs before network

daemon@ATHENA.MIT.EDU (Fast Cart)
Thu Aug 21 01:49:21 1997

Date: Thu, 21 Aug 97 01:49:02 -0400
To: linux-dev@MIT.EDU
From: Fast Cart <fastcart@MIT.EDU>

Ok.  I worked on the scripts, but there's a snag.  I've successfully made
scripts that brings down afs before shutting down the network (Btw, these are
the 4.0 versions of the script, I'm hoping 4.2's aren't that different.).  I'd
like to thank Aaron for his help.  The files are /etc/rc.d/init.d/network:

ORIGINAL:

  stop)
	for i in $interfaces; do
		./ifdown $i boot
	done
	./ifdown ifcfg-lo
        rm -f /var/lock/subsys/network
        ;;

EDITED:

  stop)
        if [ -f /var/lock/subsys/athena ]; then
           /etc/rc.d/init.d/athena.init stop
           if grep "^libafs" /proc/modules; then
            killall afsd
            rmmod libafs
           fi
        fi
	for i in $interfaces; do
		./ifdown $i boot
	done
	./ifdown ifcfg-lo
        rm -f /var/lock/subsys/network
        ;;


And /etc/pcmcia/network:

ORIGINAL:

'stop')
	/etc/sysconfig/network-scripts/ifdown /etc/sysconfig/network-scripts/ifcfg-${device}
    ;;

EDITED:

'stop')
        if [ -f /var/lock/subsys/athena ]; then
           echo
           /etc/rc.d/init.d/athena.init stop
           if grep "^libafs" /proc/modules; then
            killall afsd
            rmmod libafs
           fi
        fi
	/etc/sysconfig/network-scripts/ifdown /etc/sysconfig/network-scripts/ifcfg-${device}
    ;;

Now, Derek said we should also make it so that afs comes back up when the
network is back up.  If I am to use what I did for shutting down the network
as a basis, then I think we have a problem.  All I'm doing is calling the
athena.init script from within the two network scripts.  If I were to start
athena.init under them, how do we solve the problem of both of them being
called at boot time (once in the network script, and the other after NFS
starts under runlevel 3 and 5)?  And we know that if afs starts on a machine
when it's already running, the system crashes.  Or am I missing something?

If I am correct and this is a problem, we could:

1) Just drop in the edited scripts as is.
   a) We may want to edit the RedHat initscripts package (yeah, right.).
   b) Edit the afs package to add the changes into the networks scripts.  The
      drawback is if someone uninstalls the afs package, the networks scripts
      may not be left as they originally were, thus causing problems in them.
   c) Have two sets of initscripts packages (one for regular RedHat and the
      other for Athena [yeah, right again]).

2) Leave the network scripts alone and make it extremely clear that users
   should shutdown afs before shutting down the network (which they'll just
   ignore).

I think we should go with 1b and "Hope for the best, but expect the worse."
But, that means more work for Derek.

Comments?

Fast Cart

home help back first fref pref prev next nref lref last post