[1541] in Moira

home help back first fref pref prev next nref lref last post

gen script changes

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed May 3 20:32:24 2000

Message-Id: <200005040032.UAA02053@RIFF-RAFF-W20.MIT.EDU>
To: moiradev@MIT.EDU
Date: Wed, 03 May 2000 20:32:20 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	Pretty self explanatory.  Also includes a rewrite of nfs.sh to
be in the Bourne shell.

Index: acl.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/acl.sh,v
retrieving revision 1.3
diff -c -r1.3 acl.sh
*** acl.sh	2000/04/10 19:40:07	1.3
--- acl.sh	2000/05/04 00:12:51
***************
*** 1,5 ****
--- 1,10 ----
  #!/bin/sh
  # $Id: acl.sh,v 1.3 2000/04/10 19:40:07 zacheiss Exp $
+ 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
  
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
Index: boot.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/boot.sh,v
retrieving revision 1.2
diff -c -r1.2 boot.sh
*** boot.sh	1999/03/30 04:02:03	1.2
--- boot.sh	2000/05/04 00:14:12
***************
*** 1,6 ****
--- 1,12 ----
  #! /bin/sh
  # $Id: boot.sh,v 1.2 1999/03/30 04:02:03 danw Exp $
  
+ 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
+ 
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
  MR_MISSINGFILE=47836473
Index: hesiod.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/hesiod.sh,v
retrieving revision 1.18
diff -c -r1.18 hesiod.sh
*** hesiod.sh	1999/09/29 21:46:26	1.18
--- hesiod.sh	2000/05/04 00:14:25
***************
*** 2,8 ****
  # This script performs updates of hesiod files on hesiod servers.
  # $Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/hesiod.sh,v 1.18 1999/09/29 21:46:26 kcr Exp $
  
! exec >/tmp/moira_update.log 2>&1
  set -x 
  
  PATH=/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc
--- 2,13 ----
  # This script performs updates of hesiod files on hesiod servers.
  # $Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/hesiod.sh,v 1.18 1999/09/29 21:46:26 kcr Exp $
  
! 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
Index: mailhub.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/mailhub.sh,v
retrieving revision 1.7
diff -c -r1.7 mailhub.sh
*** mailhub.sh	1998/01/15 19:02:51	1.7
--- mailhub.sh	2000/05/04 00:14:52
***************
*** 1,6 ****
--- 1,12 ----
  #!/bin/sh
  PATH=/bin:/usr/ucb:/usr/bin
  
+ 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
+ 
  MR_MKCRED=47836474
  
  cat /usr/lib/aliases.legacy > /usr/lib/aliases.tmp
Index: ndb.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/ndb.sh,v
retrieving revision 1.1
diff -c -r1.1 ndb.sh
*** ndb.sh	2000/02/27 19:10:55	1.1
--- ndb.sh	2000/05/04 00:19:51
***************
*** 1,4 ****
--- 1,10 ----
  #!/bin/sh
+ 
+ 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
   
  root=/usr/local/nic/db
  PATH=/sbin:/bin:root/bin
Index: nfs.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/nfs.sh,v
retrieving revision 1.23
diff -c -r1.23 nfs.sh
*** nfs.sh	1999/09/02 21:39:03	1.23
--- nfs.sh	2000/05/04 00:20:26
***************
*** 1,99 ****
! #!/bin/csh -f
  # This script performs nfs updates on servers.
  #
! # $Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/nfs.sh,v 1.23 1999/09/02 21:39:03 danw Exp $
  
! # The following exit codes are defined and MUST BE CONSISTENT with the
! # error codes the library uses:
! set MR_NOCRED = 47836470
! set MR_MKCRED = 47836474
! set MR_TARERR = 47836476
! 
! set path=(/etc /bin /usr/bin /usr/etc /usr/athena/etc)
! set nonomatch
! 
! # The file containg the information for the update
! set TARFILE=/var/tmp/nfs.out
! # The directory into which we will empty the tarfile
! set SRC_DIR=/var/tmp/nfs.dir
! 
! # Alert if the tarfile does not exist
! if (! -r $TARFILE) then
!    exit $MR_TARERR
! endif
! 
! # Create a fresh source directory
! rm -rf $SRC_DIR
! mkdir $SRC_DIR
! chmod 755 $SRC_DIR
! 
! set uchost=`hostname | tr '[a-z]' '[A-Z]'`
! if ($uchost !~ *.*) then
!     set uchost=$uchost.MIT.EDU
! endif
! 
! cd $SRC_DIR
! 
! # Just extract everything since some of what we need exists as
! # hardlinks and tar doesn't deal well with extracting them in isolation.
! tar xf $TARFILE
! if ($status) exit $MR_TARERR
! 
! foreach type (dirs quotas)
!    echo "Installing ${type}:"
!    foreach i ( ${uchost}*.${type} )
!      if (-e $i) then
! 	# Convert the from the filename HOST.@dev@device.type to /dev/device
! 	set dev=`echo $i |  sed "s,.${type},," | sed "s,${uchost}.,," | sed "s,@,/,g"`
! 	echo ${uchost}:$dev
! 	./install_${type} $dev < $i
! 	if ($status) exit $status
! 	if ($type == quotas) ./zero_quotas $dev < $i
! 	if ($status) exit $status
! 	# save the files used here for later debugging
! 	mv $i /var/tmp
!      endif
!    end
! end
! 
! # find credentials directory (not robust, but works for the current
! # situation)
! set creddir = /var/athena
! if (-d /usr/etc) then
!     set creddir = /usr/etc
! endif
  
! # build new credentials files.
  rm -f $creddir/credentials.new
  cp ${uchost}.cred $creddir/credentials.new
! if ($status) exit $MR_NOCRED
! if (-e $creddir/credentials.local) then
      cat $creddir/credentials.local >> $creddir/credentials.new
! endif
  
! # After this point, if /tmp gets cleared out by reactivate (which
! # happens on a combined server/workstation) we don't care.
  mkcred $creddir/credentials.new
! if ($status) exit $MR_MKCRED
  
  # Try to install the files
! foreach e ( "" .dir .pag)
!    mv -f $creddir/credentials.new$e $creddir/credentials$e
! end
  
  # If any of them didn't get installed, fail
! foreach e ( "" .dir .pag)
!    if (! -e $creddir/credentials$e) exit $MR_NOCRED
! end
! 
! 
  
  # cleanup
! if ( -f $TARFILE ) rm -f $TARFILE
! if ( -d $SRC_DIR ) then
!   cd $SRC_DIR/..
!   rm -rf $SRC_DIR
! endif
! if ( -f $0 ) rm -r $0
  
  exit 0
--- 1,102 ----
! #!/bin/sh
  # This script performs nfs updates on servers.
  #
! # $Header$
  
! # redirect output, and find the credentials directory (not robust, but
! # works for now).
! if [ -d /var/athena ] && [ -w /var/athena ]; then
!     creddir=/var/athena
!     exec >/var/athena/moira_update.log 2>&1
! else 
!     creddir=/usr/etc
!     exec >/tmp/moira_update.log 2>&1
! fi
  
! # The following exit codes are defined and MUST BE CONSISTENT with the 
! # error codes the library uses:
! MR_NOCRED=47836470
! MR_MISSINGFILE=47836473
! MR_MKCRED=47836474
! MR_TARERR=47836476
! 
! PATH=/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc
! 
! TARFILE=/var/tmp/nfs.out
! SRCDIR=/var/tmp/nfs.dir
! 
! uchost=`hostname | tr '[a-z]' '[A-Z]'`
! echo $uchost | egrep -e "." >/dev/null
! if [ $? != 0 ]; then
!     uchost=$uchost.MIT.EDU
! fi
! 
! # Alert if the tar file does not exist
! test -r $TARFILE || exit $MR_MISSINGFILE
! 
! # Make a temporary directory to unpack the tar file into
! mkdir $SRCDIR || exit $MR_MKCRED
! cd $SRCDIR || exit $MR_MKCRED
! 
! # Extract everything
! tar xpf $TARFILE || exit $MR_TARERR
! 
! for type in dirs quotas; do
!     echo "Installing ${type}:"
!     for i in $uchost.$type; do
! 	if [ -f $i ]; then
! 	    # Convert from the filename HOST.@dev@device.type to /dev/device
! 	    dev=`echo $i | sed "s,.${type},," | sed "s,${uchost}.,," | \
! 		sed "s,@,/,g"`
! 	    echo ${uchost}:$dev
! 	    ./install_${type} $dev < $i
! 	    if [ $? != 0 ]; then
! 		exit $MR_NOCRED
! 	    fi
! 	    if [ ${type} = "quotas" ]; then
! 		./zero_quotas $dev < $i
! 		if [ $? != 0 ]; then
! 		    exit $MR_NOCRED
! 		fi
! 	    fi
! 	    mv -f $i /var/tmp
!         fi
!     done
! done
!     
! # build new credentials files
  rm -f $creddir/credentials.new
  cp ${uchost}.cred $creddir/credentials.new
! if [ $? != 0 ]; then
!     exit $MR_NOCRED
! fi
! if [ -s $creddir/credentials.local ]; then
      cat $creddir/credentials.local >> $creddir/credentials.new
! fi
  
! # After this point, if /tmp gets cleared out by reactivate (which happens
! # on a combined server/workstation), we don't care.
  mkcred $creddir/credentials.new
! if [ $? != 0 ]; then
!     exit $MR_MKCRED
! fi
  
  # Try to install the files
! for e in "" .dir .pag; do
!     mv -f $creddir/credentials.new$e $creddir/credentials$e
! done
  
  # If any of them didn't get installed, fail
! for e in "" .dir .pag; do
!     if [ ! -f $creddir/credentials$e ]; then
! 	exit $MR_NOCRED
!     fi
! done
  
  # cleanup
! cd /
! rm -rf $SRCDIR
! test -f $TARFILE && rm -f $TARFILE
! test -f $0 && rm -f $0
  
  exit 0
Index: postoffice.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/postoffice.sh,v
retrieving revision 1.2
diff -c -r1.2 postoffice.sh
*** postoffice.sh	2000/02/27 19:10:40	1.2
--- postoffice.sh	2000/05/04 00:20:53
***************
*** 6,11 ****
--- 6,17 ----
  PATH=/sbin:/bin:/usr/sbin:/usr/bin:/etc:/usr/etc:/usr/athena/bin:/usr/local/bin
  export PATH
  
+ 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
+ 
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
  MR_NOCRED=47836470
Index: print.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/print.sh,v
retrieving revision 1.3
diff -c -r1.3 print.sh
*** print.sh	1999/12/06 15:16:08	1.3
--- print.sh	2000/05/04 00:21:05
***************
*** 1,6 ****
--- 1,12 ----
  #! /bin/sh
  # $Id: print.sh,v 1.3 1999/12/06 15:16:08 danw Exp $
  
+ 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
+ 
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
  MR_MISSINGFILE=47836473
Index: sapprint.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/sapprint.sh,v
retrieving revision 1.1
diff -c -r1.1 sapprint.sh
*** sapprint.sh	1999/09/17 21:25:24	1.1
--- sapprint.sh	2000/05/04 00:21:17
***************
*** 1,6 ****
--- 1,12 ----
  #! /bin/sh
  # $Id: sapprint.sh,v 1.1 1999/09/17 21:25:24 mwhitson Exp $
  
+ 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
+ 
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
  MR_MISSINGFILE=47836473
Index: warehouse.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/warehouse.sh,v
retrieving revision 1.3
diff -c -r1.3 warehouse.sh
*** warehouse.sh	1998/01/07 17:13:21	1.3
--- warehouse.sh	2000/05/04 00:21:42
***************
*** 6,11 ****
--- 6,17 ----
  
  PATH="/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc"
  
+ 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
+ 
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
  set MR_MISSINGFILE = 	47836473
Index: www.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/www.sh,v
retrieving revision 1.1
diff -c -r1.1 www.sh
*** www.sh	2000/01/10 21:56:36	1.1
--- www.sh	2000/05/04 00:21:53
***************
*** 5,10 ****
--- 5,16 ----
  PATH=/sbin:/bin:/usr/sbin:/usr/bin:/etc:/usr/etc:/usr/athena/bin:/usr/local/bin
  export PATH
  
+ 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
+ 
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
  MR_HESFILE=47836472
Index: zephyr.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/zephyr.sh,v
retrieving revision 1.3
diff -c -r1.3 zephyr.sh
*** zephyr.sh	2000/04/04 21:03:18	1.3
--- zephyr.sh	2000/05/04 00:22:05
***************
*** 1,6 ****
--- 1,12 ----
  #!/bin/sh
  # $Id: zephyr.sh,v 1.3 2000/04/04 21:03:18 zacheiss Exp $
  
+ 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
+ 
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
  MR_MISSINGFILE=47836473

home help back first fref pref prev next nref lref last post