From bbd02aec3be8ce3cf58398ff36dc4ca2b737b93d Mon Sep 17 00:00:00 2001 From: zacheiss Date: Thu, 25 Oct 2007 14:47:54 +0000 Subject: [PATCH] service script for RT to set permissions on the generated file, and Makefile glue to install it. --- gen/Makefile.in | 11 ++++++----- gen/rt.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100755 gen/rt.sh diff --git a/gen/Makefile.in b/gen/Makefile.in index b24ed0a0..395ac93c 100644 --- a/gen/Makefile.in +++ b/gen/Makefile.in @@ -44,11 +44,12 @@ TARGET= acl.gen boot.gen dhcp.gen directory.gen events.gen hesiod.gen hosts.gen SCRIPTS=access.gen access.sh acl.sh aliases.sh boot.sh ca.gen calendar.gen \ confluence.gen dhcp.sh events.sh hesiod.sh ip-billing.gen \ - ip-billing.sh ldap.gen longjobs.gen longjobs.sh mailhosts.gen mailhub.sh \ - mailman.gen mailman.sh nagios-colo.gen nagios-colo.sh nagios-printers.gen \ - nagios-printers.sh ndb.sh nfs.sh null.sh postoffice.sh print.sh sapprint.gen \ - sapprint.sh spwatch.gen tsm.gen tsm.sh warehouse.gen warehouse.sh \ - winstats.gen winstats.sh www.sh zephyr.sh install_dirs install_quotas zero_quotas + ip-billing.sh ldap.gen longjobs.gen longjobs.sh mailhosts.gen \ + mailhub.sh mailman.gen mailman.sh nagios-colo.gen nagios-colo.sh \ + nagios-printers.gen nagios-printers.sh ndb.sh nfs.sh null.sh \ + postoffice.sh print.sh rt.sh sapprint.gen sapprint.sh spwatch.gen \ + tsm.gen tsm.sh warehouse.gen warehouse.sh winstats.gen winstats.sh \ + www.sh zephyr.sh install_dirs install_quotas zero_quotas .SUFFIXES: .pc .gen diff --git a/gen/rt.sh b/gen/rt.sh new file mode 100755 index 00000000..4536303b --- /dev/null +++ b/gen/rt.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# $Id$ + +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 + +PATH=/bin +OUTFILE=/usr/local/rtadmin/work/moira.out + +# Alert if the output file doesn't exist +test -r $OUTFILE || exit $MR_MISSINGFILE + +# Set the perms usefully +chown root $OUTFILE +chgrp 0 $OUTFILE +chmod 644 $OUTFILE + +# cleanup +test -f $0 && rm -f $0 + +exit 0 -- 2.45.1