[OpenAFS] Problems in stopping the afs-client

Andrei Maslennikov Andrei Maslennikov <andrei@caspur.it>
Fri, 18 Oct 2002 15:56:12 +0000 ( )


"Klaas Hagemann" <kerberos@northsailor.de> writes:

> 
> i have problems in stopping the AFS-Client in the new Version (1.2.7)
> The libafs-module is always in use, so that i cannot rmmod it.
> As far as i can see it are there no processes running on /afs/.
> I am using suse linux 8.1, 2,4,19.
> 

  It might be that the old problem with "umount /afs" that we have
  signalled to Transarc a couple of years may still be around.
  At that time we have noted that, if the following sequence
  of events occurs:

       1) AFS is started on the client that has its clock
          not in sync with that of the servers;

       2) Our post-start script (invoked from within AFS) adjusts
          the clock of the client to that of servers without 
          waiting until afsd does it by itself.

  then, if we try to "unmount /afs", this command hangs for
  the time equal to that of the initial time shift between
  the client and servers. If no activity inside /afs occurs
  between its start and the attempt to unmount, there are
  no delays.

  The workaround is pretty simple, as it is enough to sync the
  client and servers' clocks *BEFORE* afsd was started. We added
  it to our afsclient rpm (see a 3-line script below), and since 
  then have never worried about it. That we observed in 1998-1999,
  and I thought it was ironed out by Transarc. Clearly, if the 
  problem is still there, it has to be solved in a more systematic
  way.

  Andrei.



NB: The script obviously makes sense only if CellServDB
    is used on the client (not "-afsdb").

[root@main ~]# cat /usr/vice/etc/settime.sh
#!/bin/sh
#
# andrei@caspur.it - 1999
#
# This sets the client's clock in sync with that of AFS server(s).
# Hopefully at least one server declared in CellServDB 
# will respond...
# 
#

read cell < /usr/vice/etc/ThisCell
awk -v cell=$cell 'BEGIN{incell=0; cell=">"cell; nsrv=0}
{
   if($1==cell)                      { getline; incell=1 } 
   if(incell && substr($1,1,1)==">") { incell=0 }
   if(incell)                        { nsrv++; srv[nsrv]=$1 }   
}  
END{
   for(i=1;i<=nsrv;i++) { 
      com="/usr/afsws/etc/ntp -sf "srv[i]" >/dev/null 2>&1"; system(com)
   } 
}' /usr/vice/etc/CellServDB