Commit 38dac6b1 authored by Andrew McNab's avatar Andrew McNab
Browse files

More consistent script.batchtype naming

parent da490741
......@@ -31,9 +31,11 @@
include VERSION
INSTALL_FILES=VERSION prologue.user epilogue.user mjf.init \
mjf-torque.sh mjf-torque.csh mjf-get-total-cpu.torque \
mjf-htcondor.sh mjf-htcondor.csh mjf-job-wrapper htcondor-jobfeatures
INSTALL_FILES=VERSION mjf.init \
prologue.user epilogue.user \
mjf.sh.torque mjf.csh.torque mjf-get-total-cpu.torque \
mjf.sh.htcondor mjf.csh.htcondor mjf-get-total-cpu.htcondor \
mjf-job-wrapper make-jobfeatures.htcondor
TGZ_FILES=$(INSTALL_FILES) Makefile mjf-torque.spec mjf-htcondor.spec README
......@@ -51,9 +53,9 @@ install: $(INSTALL_FILES)
$(RPM_BUILD_ROOT)/etc/rc.d/init.d/mjf
torque-install: $(INSTALL_FILES) install
cp mjf-torque.sh \
cp mjf.sh.torque \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.sh
cp mjf-torque.csh \
cp mjf.csh.torque \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.csh
mkdir -p $(RPM_BUILD_ROOT)/var/lib/torque/mom_priv
mkdir -p $(RPM_BUILD_ROOT)/usr/sbin
......@@ -73,12 +75,16 @@ torque-rpm: mjf-scripts.tgz
--buildroot $(shell pwd)/RPMTMP/BUILDROOT mjf-torque.spec
htcondor-install: $(INSTALL_FILES) install
cp mjf-htcondor.sh \
cp mjf.sh.htcondor \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.sh
cp mjf-htcondor.csh \
cp mjf.csh.htcondor \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.csh
cp mjf-job-wrapper htcondor-jobfeatures \
cp mjf-job-wrapper \
$(RPM_BUILD_ROOT)/usr/sbin
cp make-jobfeatures.htcondor \
$(RPM_BUILD_ROOT)/usr/sbin/make-jobfeatures
cp mjf-get-total-cpu.htcondor \
$(RPM_BUILD_ROOT)/usr/sbin/mjf-get-total-cpu
htcondor-rpm: mjf-scripts.tgz
rm -Rf RPMTMP
......
#!/usr/bin/python
#
# htcondor-jobfeatures script for Machine/Job Features on HTCondor
# make-jobfeatures script for Machine/Job Features on HTCondor
#
# Andrew McNab, University of Manchester.
# Copyright (c) 2016. All rights reserved.
......@@ -68,13 +68,13 @@ os.umask(0022)
try:
fromMachineAd = open(os.environ['_CONDOR_MACHINE_AD'],'r').read()
except:
sys.stderr.write('Could not read $_CONDOR_MACHINE_AD file - exiting htcondor-jobfeatures\n')
sys.stderr.write('Could not read $_CONDOR_MACHINE_AD file - exiting make-jobfeatures\n')
sys.exit(10)
try:
fromJobAd = open(os.environ['_CONDOR_JOB_AD'],'r').read()
except:
sys.stderr.write('Could not read $_CONDOR_JOB_AD file - exiting htcondor-jobfeatures\n')
sys.stderr.write('Could not read $_CONDOR_JOB_AD file - exiting make-jobfeatures\n')
sys.exit(10)
try:
......@@ -227,3 +227,7 @@ if hs06_job:
# We got it from somewhere
open(jobfeaturesDir + '/hs06_job', 'w').write('%.2f' % hs06_job)
# We output $JOBFEATURES in case the calling script needs it
print jobfeaturesDir
\ No newline at end of file
#!/bin/sh
#
# Output the number of processors assigned by HTCondor on this host.
#
# This script must be installed as /usr/sbin/mjf-get-total-cpu to be
# picked up by the generic /etc/rc.d/init.d/mjf !
#
# Andrew.McNab@cern.ch
#
condor_config_val NUM_CPUS
......@@ -43,14 +43,18 @@
# the htcondor-jobfeatures Python script to create $JOBFEATURES
#
# This script outputs the value of $JOBFEATURES. (We could just
# run the script without recording the value of $JOBFEATURES.)
jobfeatures=`/usr/sbin/htcondor-jobfeatures`
# This script outputs the value of $JOBFEATURES. This variable
# should be coming from /etc/profile/mjf.[c]sh too!
export JOBFEATURES=`/usr/sbin/make-jobfeatures`
if [ -d /etc/machinefeatures ] ; then
export MACHINEFEATURES=/etc/machinefeatures
fi
$*
# We tidy these up. They are in /tmp by default so we could just
# leave them to be removed by the system instead.
if [ -d "$jobfeatures" ] ; then
rm -Rf "$jobfeatures"
if [ -d "$JOBFEATURES" ] ; then
rm -Rf "$JOBFEATURES"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment