]> andersk Git - moira.git/commitdiff
longjobs service script and Makefile.in changes to install it.
authorzacheiss <zacheiss>
Sat, 25 Aug 2001 12:06:34 +0000 (12:06 +0000)
committerzacheiss <zacheiss>
Sat, 25 Aug 2001 12:06:34 +0000 (12:06 +0000)
gen/Makefile.in
gen/longjobs.sh [new file with mode: 0755]

index 9e076a0d086a925b3e7634bf7ba87b60452539a6..6fc9663fecc533369388517fcd64be7d69e06c8a 100644 (file)
@@ -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 (executable)
index 0000000..df4ee8f
--- /dev/null
@@ -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
This page took 0.039755 seconds and 5 git commands to generate.