[OpenAFS-devel] init script modification suggestion

Atro Tossavainen atro.tossavainen+openafs@helsinki.fi
Tue, 5 May 2009 14:42:44 +0300 (EEST)


(Don't know if this is useful to anybody, but here goes.  It's
also not that pretty and probably not as efficient as it could be)

I don't want to have dynroot on the clients because AFAIK it
prevents me from being able to utilize a shorter symlink for our
somewhat long cell name, and the difference between 21 characters
of biocenter.helsinki.fi and 2 of "bi" just seems to be significant
enough for many programs that (I can't avoid and that) have 80-
character restrictions on path lengths that it's useful to me to
stick to having a static root.afs so I can use the symlink.

So I have a situation where I'm firing up a laptop that has some form
of network connectivity, but for whichever reason (restrictive firewall
on a foreign site, for example), no visibility to our AFS servers.

"No interfaces with IP address" doesn't fire because the machine does
have an interface with an IP address, but starting up AFS in such a
situation leads to timeouts and as a result, the bootup taking ages
and the user becoming frustrated.

Right after the bit with "No interfaces", add this in the on_network
section of the init script:

    if ! is_on $ENABLE_DYNROOT; then
        THISCELL=`cat /usr/afs/etc/ThisCell`
        AFSSERVERS=`grep $THISCELL /usr/afs/etc/CellServDB | grep -v '^>' | awk '{ print $1 }'`
        NOAFS=1

        for i in $AFSSERVERS; do
            if ping -c 1 $i; then NOAFS=0; return 0; fi
        done

        if [ $NOAFS -eq 1 ]; then
            echo afs: Cannot ping any of the $THISCELL VL servers, not starting AFS
            return 1
        fi
    fi

(just before return 0)

so that AFS is not started if the machine does have a non-localhost
IP address but no visibility to the designated cell's VL servers.

I'm perfectly aware of the fact that this is an edge case even for
ourselves and that most folks are probably content with dynroot so
this never becomes an issue...

-- 
Atro Tossavainen (Mr.)               / The Institute of Biotechnology at
Systems Analyst, Techno-Amish &     / the University of Helsinki, Finland,
+358-9-19158939  UNIX Dinosaur     / employs me, but my opinions are my own.
< URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS