From: zacheiss Date: Sat, 25 Aug 2001 12:06:34 +0000 (+0000) Subject: longjobs service script and Makefile.in changes to install it. X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/8cb26d352150a465b2dde41c0eacaf03551de46c longjobs service script and Makefile.in changes to install it. --- diff --git a/gen/Makefile.in b/gen/Makefile.in index 9e076a0d..6fc9663f 100644 --- a/gen/Makefile.in +++ b/gen/Makefile.in @@ -42,8 +42,8 @@ TARGET= acl.gen boot.gen dhcp.gen directory.gen hesiod.gen hosts.gen \ mailhub.gen ndb.gen network.gen nfs.gen pobox.gen \ postoffice.gen print.gen warehouse.gen winad.gen www.gen zephyr.gen -SCRIPTS=boot.sh ca.gen dhcp.sh hesiod.sh longjobs.gen mailhub.sh ndb.sh \ - nfs.sh null.sh postoffice.sh print.sh sapprint.gen sapprint.sh \ +SCRIPTS=boot.sh ca.gen dhcp.sh hesiod.sh longjobs.gen longjobs.sh mailhub.sh \ + ndb.sh nfs.sh null.sh postoffice.sh print.sh sapprint.gen sapprint.sh \ spwatch.gen warehouse.sh www.sh zephyr.sh install_dirs \ install_quotas zero_quotas diff --git a/gen/longjobs.sh b/gen/longjobs.sh new file mode 100755 index 00000000..df4ee8fa --- /dev/null +++ b/gen/longjobs.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# $Id$ + +# Wrapper script to install the groups file output by moira, and update +# the quota database for current group membership. + +spooldir=/var/spool/pbs +spool_etcdir=$spooldir/etc +exec_prefix=/usr/pbs +sbindir=${exec_prefix}/sbin +update_group=${sbindir}/update_group +groups=${spool_etcdir}/groups +quotadb=${spool_etcdir}/quotadb + +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 +MR_MKCRED=47836474 + +test -r ${groups}.out || exit $MR_MISSINGFILE + +if [ -s ${groups}.out ]; then + mv ${groups}.out $groups + ${update_group} -d $quotadb -a + if [ $? != 0 ]; then + exit $MR_MKCRED + fi +fi + +# cleanup +test -f $0 && rm -f $0 + +exit 0