From a617210d68a862ed7d83ec3444ea2a9d1138d636 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 24 Apr 2015 21:57:00 -0700 Subject: [PATCH] add some hacks to manipulate services better --- torque.spec | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/torque.spec b/torque.spec index 8da6b7a..da27a35 100644 --- a/torque.spec +++ b/torque.spec @@ -71,7 +71,7 @@ Name: torque Version: 4.2.10 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tera-scale Open-source Resource and QUEue manager Source0: http://www.adaptivecomputing.com/download/%{name}/%{name}-%{version}.tar.gz Source2: xpbs.desktop @@ -135,6 +135,8 @@ BuildRequires: tetex-latex %endif %endif +Requires(post): /bin/grep /etc/services + %description TORQUE (Tera-scale Open-source Resource and QUEue manager) is a resource manager providing control over batch jobs and distributed compute nodes. @@ -496,21 +498,17 @@ EOF rm -rf %{buildroot} %post -if grep -q "PBS services" /etc/services;then - : PBS services already installed -else - cat<<__EOF__>>/etc/services -# Standard PBS services -pbs 15001/tcp # pbs server (pbs_server) -pbs 15001/udp # pbs server (pbs_server) -pbs_mom 15002/tcp # mom to/from server -pbs_mom 15002/udp # mom to/from server -pbs_resmom 15003/tcp # mom resource management requests -pbs_resmom 15003/udp # mom resource management requests -pbs_sched 15004/tcp # scheduler -pbs_sched 15004/udp # scheduler +for srvs in pbs:15001 pbs_mon:15002 pbs_resmom:15003 pbs_sched:15004 ; do + port=${srvs/*:/} + srvs=${srvs/:*/} + for proto in tcp udp ; do + if ! grep -q $srvs'\W\W*'$port'/'$proto /etc/services;then + cat<<__EOF__>>/etc/services +$srvs $port/$proto __EOF__ -fi + fi + done +done %posttrans client /usr/sbin/alternatives --install %{_bindir}/qsub qsub %{_bindir}/qsub-torque 10 \ @@ -815,6 +813,9 @@ fi %endif %changelog +* Fri Apr 24 2015 David Brown - 4.2.10-2 +- Bugfix - #1154413 make manipulating services better. + * Mon Apr 6 2015 David Brown - 4.2.10-1 - Updated upstream version