2 # This script performs updates of hesiod files on hesiod servers.
5 if [ -d /var/athena ] && [ -w /var/athena ]; then
6 exec >/var/athena/moira_update.log 2>&1
8 exec >/tmp/moira_update.log 2>&1
13 PATH=/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc
16 # The following exit codes are defined and MUST BE CONSISTENT with the
17 # error codes the library uses:
19 MR_MISSINGFILE=47836473
25 # File that will contain the necessary information to be updated
26 TARFILE=/var/tmp/hesiod.out
27 # Directory into which we will empty the tarfile
28 SRC_DIR=/etc/athena/_nameserver
29 # Directory into which we will put the final product
30 DEST_DIR=/etc/athena/nameserver
32 INIT=/etc/init.d/athena-bind
33 NAMED_PID=/var/athena/named.pid
35 # Create the destination directory if it doesn't exist
36 if test ! -d $DEST_DIR
43 # If $SRC_DIR does not already exist, make sure that it gets created
44 # on the same parition as $DEST_DIR.
47 # Tell linux cd/pwd not to be so "helpful".
48 # This will generate an ignorable error on older platforms.
54 if test $SRC_DIR != `pwd`
60 # make sure SRC_DIR is empty
61 /bin/rm -rf $SRC_DIR/*
63 # Alert if tarfile doesn't exist
71 # Don't put up with errors extracting the information
78 # Make sure the file is not zero-length
93 # Kill off the current named and remove the named.pid file. It is
94 # important that this file be removed since the script uses its
95 # existance as evidence that named as has been successfully restarted.
97 # First, get statistics
98 /usr/athena/etc/rndc stats
106 # This timeout is implemented by having the shell check TIMEOUT times
107 # for the existance of $NAMED_PID and to sleep INTERVAL seconds
108 # between each check.
110 TIMEOUT=60 # number of INTERVALS until timeout
111 INTERVAL=60 # number of seconds between checks
113 while test $i -lt $TIMEOUT
115 if test -f $NAMED_PID
122 echo out of timeout loop
124 if test $i -eq $TIMEOUT