2 # This script performs updates of hesiod files on hesiod servers.
5 exec >/tmp/moira_update.log 2>&1
8 PATH=/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc
11 # The following exit codes are defined and MUST BE CONSISTENT with the
12 # error codes the library uses:
14 MR_MISSINGFILE=47836473
20 # File that will contain the necessary information to be updated
21 TARFILE=/var/tmp/nhesiod.out
22 # Directory into which we will empty the tarfile
23 SRC_DIR=/etc/athena/_nameserver
24 # Directory into which we will put the final product
25 DEST_DIR=/etc/athena/nameserver
27 NAMED=/etc/athena/named
28 NAMED_PID=/var/athena/named.pid
30 # Create the destination directory if it doesn't exist
31 if test ! -d $DEST_DIR
38 # If $SRC_DIR does not already exist, make sure that it gets created
39 # on the same parition as $DEST_DIR.
45 if test $SRC_DIR != `pwd`
51 # make sure SRC_DIR is empty
52 /bin/rm -rf $SRC_DIR/*
54 # Alert if tarfile doesn't exist
62 # Don't put up with errors extracting the information
69 # Make sure the file is not zero-length
83 # Kill off the current named and remove the named.pid file. It is
84 # important that this file be removed since the script uses its
85 # existance as evidence that named as has been successfully restarted.
87 # First, get statistics
88 kill -ILL `cat $NAMED_PID`
90 kill -KILL `cat $NAMED_PID`
98 # This timeout is implemented by having the shell check TIMEOUT times
99 # for the existance of $NAMED_PID and to sleep INTERVAL seconds
100 # between each check.
102 TIMEOUT=60 # number of INTERVALS until timeout
103 INTERVAL=60 # number of seconds between checks
105 while test $i -lt $TIMEOUT
107 if test -f $NAMED_PID
114 echo out of timeout loop
116 if test $i -eq $TIMEOUT