]> andersk Git - moira.git/blobdiff - gen/hesiod.sh
Diane Delgado's changes for a fixed table-locking order
[moira.git] / gen / hesiod.sh
index fdd148aa0c8a67e1b5058e5b47c230ab38f396b0..1e9cdeeba156c73989dc872627f687783fae0969 100644 (file)
@@ -1,7 +1,8 @@
-#!/bin/csh -f -x
+#!/bin/csh -f
 # This script performs updates of hesiod files on hesiod servers.  
-#      $Source$
-echo   '$Header$'
+# $Header$
+
+set path=(/etc /bin /usr/bin /usr/etc /usr/athena/etc)
 
 # The following exit codes are defined and MUST BE CONSISTENT with the
 # MR error codes the library uses:
@@ -13,7 +14,7 @@ set MR_TARERR =       47836476
 umask 22
 
 # File that will contain the necessary information to be updated
-set TARFILE=/tmp/hesiod.out
+set TARFILE=/var/tmp/hesiod.out
 # Directory into which we will empty the tarfile
 set SRC_DIR=/etc/athena/_nameserver
 # Directory into which we will put the final product
@@ -21,9 +22,9 @@ set DEST_DIR=/etc/athena/nameserver
 
 # Create the destination directory if it doesn't exist
 if (! -d $DEST_DIR) then
-   /bin/rm -f $DEST_DIR
-   /bin/mkdir $DEST_DIR
-   /bin/chmod 755 $DEST_DIR
+   rm -f $DEST_DIR
+   mkdir $DEST_DIR
+   chmod 755 $DEST_DIR
 endif
 
 # If $SRC_DIR does not already exist, make sure that it gets created
@@ -32,7 +33,9 @@ if (! -d $SRC_DIR) then
        chdir $DEST_DIR
        mkdir ../_nameserver
        chdir ../_nameserver
-       if ($SRC_DIR != `pwd`) ln -s `pwd` $SRC_DIR
+       if ($SRC_DIR != `pwd`) then
+               ln -s `pwd` $SRC_DIR
+       endif
 endif
 
 # Alert if tarfile doesn't exist
@@ -41,20 +44,20 @@ if (! -r $TARFILE) exit $MR_MISSINGFILE
 # Empty the tar file one file at a time and move each file to the
 # appropriate place only if it is not zero length. 
 cd $SRC_DIR
-foreach  file (`/bin/tar tf $TARFILE | awk '{print $1}' | sed 's;/$;;'`)
+foreach  file (`tar tf $TARFILE | awk '{print $1}' | sed 's;/$;;'`)
    if (. == $file) continue
 
    rm -rf $file
    echo extracting $file
-   /bin/tar xf $TARFILE $file
+   tar xf $TARFILE $file
    # Don't put up with errors extracting the information
    if ($status) exit $MR_TARERR
    # Make sure the file is not zero-length
    if (! -z $file) then
-      /bin/mv -f $file $DEST_DIR
+      mv -f $file $DEST_DIR
       if ($status != 0) exit $MR_HESFILE
    else
-      /bin/rm -f $file
+      rm -f $file
       exit $MR_MISSINGFILE
    endif
 end
@@ -63,15 +66,22 @@ end
 # important that this file be removed since the script uses its
 # existance as evidence that named as has been successfully restarted.
 
+# First, get statistics
+rm -f /usr/tmp/named.stats
+ln -s /var/named.stats /usr/tmp/named.stats
+kill -6 `cat /etc/named.pid`
+sleep 1
 # Use /bin/kill because, due to a bug in some versions of csh, failure
 # of a builtin will cause the script to abort
-/bin/kill -KILL `/bin/cat /etc/named.pid`
+kill -KILL `cat /etc/named.pid`
 rm -f /etc/named.pid
 
 # Restart named.
-(unlimit; /etc/named&)
-sleep 5
-mv /etc/named.pid /etc/named.pid.restart
+# mv /etc/named.pid /etc/named.pid.restart
+#(unlimit; /etc/named&)
+/etc/named
+#sleep 5
+echo named started
 
 # This timeout is implemented by having the shell check TIMEOUT times
 # for the existance of /etc/named.pid and to sleep INTERVAL seconds
@@ -85,12 +95,14 @@ while ($i < $TIMEOUT)
    if (-f /etc/named.pid) break
    @ i++
 end
-
+echo out of timeout loop
 # Did it time out?
 if ($i == $TIMEOUT) exit $MR_NAMED
-
+echo no timeout
 # Clean up!
-/bin/rm -f $TARFILE
-/bin/rm -f $0
+rm -f $TARFILE
+echo removed tarfile
+rm -f $0
+echo removed self
 
 exit 0
This page took 0.035346 seconds and 4 git commands to generate.