Commit 437aa75d authored by Andrew McNab's avatar Andrew McNab
Browse files

Add mjf-onlymf

parent 46b32b7d
...@@ -36,9 +36,11 @@ INSTALL_FILES=VERSION mjf.init \ ...@@ -36,9 +36,11 @@ INSTALL_FILES=VERSION mjf.init \
mjf.sh.torque mjf.csh.torque mjf-get-total-cpu.torque \ mjf.sh.torque mjf.csh.torque mjf-get-total-cpu.torque \
mjf.sh.htcondor mjf.csh.htcondor mjf-get-total-cpu.htcondor \ mjf.sh.htcondor mjf.csh.htcondor mjf-get-total-cpu.htcondor \
mjf-job-wrapper make-jobfeatures.htcondor \ mjf-job-wrapper make-jobfeatures.htcondor \
mjf.sh.onlymf mjf.csh.onlymf \
DIRACbenchmark.py db12.init DIRACbenchmark.py db12.init
TGZ_FILES=$(INSTALL_FILES) Makefile mjf-torque.spec mjf-htcondor.spec mjf-db12.spec README TGZ_FILES=$(INSTALL_FILES) Makefile mjf-torque.spec mjf-htcondor.spec \
mjf-onlymf mjf-db12.spec README
GNUTAR ?= tar GNUTAR ?= tar
mjf-scripts.tgz: $(TGZ_FILES) mjf-scripts.tgz: $(TGZ_FILES)
...@@ -49,12 +51,27 @@ mjf-scripts.tgz: $(TGZ_FILES) ...@@ -49,12 +51,27 @@ mjf-scripts.tgz: $(TGZ_FILES)
install: $(INSTALL_FILES) install: $(INSTALL_FILES)
mkdir -p $(RPM_BUILD_ROOT)/etc/rc.d/init.d \ mkdir -p $(RPM_BUILD_ROOT)/etc/rc.d/init.d \
$(RPM_BUILD_ROOT)/etc/profile.d \ $(RPM_BUILD_ROOT)/etc/profile.d
$(RPM_BUILD_ROOT)/usr/sbin
cp mjf.init \ cp mjf.init \
$(RPM_BUILD_ROOT)/etc/rc.d/init.d/mjf $(RPM_BUILD_ROOT)/etc/rc.d/init.d/mjf
onlymf-install: $(INSTALL_FILES) install
cp mjf.sh.onlymf \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.sh
cp mjf.csh.onlymf \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.csh
onlymf-rpm: mjf-scripts.tgz
rm -Rf RPMTMP
mkdir -p RPMTMP/SOURCES RPMTMP/SPECS RPMTMP/BUILD \
RPMTMP/SRPMS RPMTMP/RPMS/noarch RPMTMP/BUILDROOT
cp -f mjf-scripts.tgz RPMTMP/SOURCES
export MJF_VERSION=$(VERSION) ; rpmbuild -ba \
--define "_topdir $(shell pwd)/RPMTMP" \
--buildroot $(shell pwd)/RPMTMP/BUILDROOT mjf-onlymf.spec
torque-install: $(INSTALL_FILES) install torque-install: $(INSTALL_FILES) install
mkdir -p $(RPM_BUILD_ROOT)/usr/sbin
cp mjf.sh.torque \ cp mjf.sh.torque \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.sh $(RPM_BUILD_ROOT)/etc/profile.d/mjf.sh
cp mjf.csh.torque \ cp mjf.csh.torque \
...@@ -65,7 +82,6 @@ torque-install: $(INSTALL_FILES) install ...@@ -65,7 +82,6 @@ torque-install: $(INSTALL_FILES) install
cp mjf-get-total-cpu.torque \ cp mjf-get-total-cpu.torque \
$(RPM_BUILD_ROOT)/usr/sbin/mjf-get-total-cpu $(RPM_BUILD_ROOT)/usr/sbin/mjf-get-total-cpu
torque-rpm: mjf-scripts.tgz torque-rpm: mjf-scripts.tgz
rm -Rf RPMTMP rm -Rf RPMTMP
mkdir -p RPMTMP/SOURCES RPMTMP/SPECS RPMTMP/BUILD \ mkdir -p RPMTMP/SOURCES RPMTMP/SPECS RPMTMP/BUILD \
...@@ -76,6 +92,7 @@ torque-rpm: mjf-scripts.tgz ...@@ -76,6 +92,7 @@ torque-rpm: mjf-scripts.tgz
--buildroot $(shell pwd)/RPMTMP/BUILDROOT mjf-torque.spec --buildroot $(shell pwd)/RPMTMP/BUILDROOT mjf-torque.spec
htcondor-install: $(INSTALL_FILES) install htcondor-install: $(INSTALL_FILES) install
mkdir -p $(RPM_BUILD_ROOT)/usr/sbin
cp mjf.sh.htcondor \ cp mjf.sh.htcondor \
$(RPM_BUILD_ROOT)/etc/profile.d/mjf.sh $(RPM_BUILD_ROOT)/etc/profile.d/mjf.sh
cp mjf.csh.htcondor \ cp mjf.csh.htcondor \
...@@ -102,6 +119,8 @@ db12-install: $(INSTALL_FILES) ...@@ -102,6 +119,8 @@ db12-install: $(INSTALL_FILES)
$(RPM_BUILD_ROOT)/usr/sbin $(RPM_BUILD_ROOT)/usr/sbin
cp db12.init \ cp db12.init \
$(RPM_BUILD_ROOT)/etc/rc.d/init.d/db12 $(RPM_BUILD_ROOT)/etc/rc.d/init.d/db12
cp DIRACbenchmark.py \
$(RPM_BUILD_ROOT)/usr/sbin
db12-rpm: mjf-scripts.tgz db12-rpm: mjf-scripts.tgz
rm -Rf RPMTMP rm -Rf RPMTMP
...@@ -111,4 +130,3 @@ db12-rpm: mjf-scripts.tgz ...@@ -111,4 +130,3 @@ db12-rpm: mjf-scripts.tgz
export MJF_VERSION=$(VERSION) ; rpmbuild -ba \ export MJF_VERSION=$(VERSION) ; rpmbuild -ba \
--define "_topdir $(shell pwd)/RPMTMP" \ --define "_topdir $(shell pwd)/RPMTMP" \
--buildroot $(shell pwd)/RPMTMP/BUILDROOT mjf-db12.spec --buildroot $(shell pwd)/RPMTMP/BUILDROOT mjf-db12.spec
\ No newline at end of file
...@@ -18,7 +18,7 @@ if [ "$total_cpu" == "" ] ; then ...@@ -18,7 +18,7 @@ if [ "$total_cpu" == "" ] ; then
# If total_cpu not given in /etc/sysconfig/db12 then count OS processors # If total_cpu not given in /etc/sysconfig/db12 then count OS processors
total_cpu=`grep '^processor[[:space:]]*:' /proc/cpuinfo | wc --lines` total_cpu=`grep '^processor[[:space:]]*:' /proc/cpuinfo | wc --lines`
mkdir -p /etc/db12 mkdir -p /etc/db12
echo '$total_cpu' > /etc/db12/total_cpu echo "$total_cpu" > /etc/db12/total_cpu
fi fi
start() { start() {
......
Name: mjf-onlymf
Version: %(echo ${MJF_VERSION:-0.0})
Release: 1
BuildArch: noarch
Summary: Machine Features (no Job Features)
License: BSD
Group: System Environment/Daemons
Source: mjf-scripts.tgz
Vendor: GridPP
Packager: Andrew McNab <Andrew.McNab@cern.ch>
%description
Machine Features implementation following HSF-TN-2016-02
(install mjf-torque or mjf-htcondor instead to get both
Machine and Job Features)
%prep
%setup -n mjf-scripts
%build
%install
make onlymf-install
%post
chkconfig mjf on
service mjf start
%preun
if [ "$1" = "0" ] ; then
# if uninstallation rather than upgrade then stop
chkconfig mjf off
service mjf stop
fi
%files
/etc/rc.d/init.d/*
/etc/profile.d/*
mjf_tmp_dir=/tmp
if ( -r /etc/sysconfig/mjf ) then
source /var/sysconfig/mjf
endif
if ( -r /var/run/mjf ) then
source /var/run/mjf
endif
if ( -d /etc/machinefeatures ) then
setenv MACHINEFEATURES /etc/machinefeatures
endif
mjf_tmp_dir=/tmp
if [ -r /etc/sysconfig/mjf ] ; then
. /etc/sysconfig/mjf
fi
if [ -r /var/run/mjf ] ; then
. /etc/sysconfig/mjf
fi
if [ -d /etc/machinefeatures ] ; then
export MACHINEFEATURES=/etc/machinefeatures
fi
\ No newline at end of file
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