]> andersk Git - moira.git/blobdiff - gen/hesiod.sh
Command line printer manipulation client, and build goo.
[moira.git] / gen / hesiod.sh
index d984c21eeedbe4b9bd6f63861338f41393250b4e..df865d6ffd7d43ffa75b7a3a9cd601027b2ab6e4 100644 (file)
@@ -2,7 +2,12 @@
 # This script performs updates of hesiod files on hesiod servers.
 # $Header$
 
-exec >/tmp/moira_update.log 2>&1
+if [ -d /var/athena ] && [ -w /var/athena ]; then
+    exec >/var/athena/moira_update.log 2>&1
+else
+    exec >/tmp/moira_update.log 2>&1 
+fi
+
 set -x 
 
 PATH=/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc
@@ -18,13 +23,13 @@ MR_TARERR=47836476
 umask 022
 
 # File that will contain the necessary information to be updated
-TARFILE=/var/tmp/nhesiod.out
+TARFILE=/var/tmp/hesiod.out
 # Directory into which we will empty the tarfile
 SRC_DIR=/etc/athena/_nameserver
 # Directory into which we will put the final product
 DEST_DIR=/etc/athena/nameserver
 
-NAMED=/etc/athena/named
+INIT=/etc/init.d/athena-bind
 NAMED_PID=/var/athena/named.pid
 
 # Create the destination directory if it doesn't exist
@@ -39,9 +44,13 @@ fi
 # on the same parition as $DEST_DIR.
 if test ! -d $SRC_DIR
 then
-       chdir $DEST_DIR
+       # Tell linux cd/pwd not to be so "helpful".
+       # This will generate an ignorable error on older platforms.
+       set -P
+
+       cd $DEST_DIR
        mkdir ../_nameserver
-       chdir ../_nameserver
+       cd ../_nameserver
        if test $SRC_DIR != `pwd`
        then
                ln -s `pwd` $SRC_DIR
@@ -69,6 +78,7 @@ do
    # Make sure the file is not zero-length
    if test ! -z $file
    then
+      chmod o+r $file
       mv -f $file $DEST_DIR
       if test $? -ne 0
       then
@@ -85,15 +95,13 @@ done
 # existance as evidence that named as has been successfully restarted.
 
 # First, get statistics
-kill -ILL `cat $NAMED_PID`
+/usr/athena/etc/rndc stats
 sleep 1
-kill -KILL `cat $NAMED_PID`
+$INIT stop
 rm -f $NAMED_PID
 
 # Restart named.
-$NAMED
-echo named started
-
+$INIT start
 sleep 1
 # This timeout is implemented by having the shell check TIMEOUT times
 # for the existance of $NAMED_PID and to sleep INTERVAL seconds
This page took 0.032141 seconds and 4 git commands to generate.