From 42a804b6959caae1c20a2ae726a5f52079675f6e Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Thu, 14 Oct 2010 23:02:55 +0200 Subject: [PATCH] - rhbz#631256 Only create db if asked to. --- torque-create-request.patch | 42 +++++++++++++++++++++++++++++++++++++ torque.spec | 8 ++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 torque-create-request.patch diff --git a/torque-create-request.patch b/torque-create-request.patch new file mode 100644 index 0000000..86a9851 --- /dev/null +++ b/torque-create-request.patch @@ -0,0 +1,42 @@ +diff -uNr torque-2.5.2.ORIG/contrib/init.d/pbs_server torque-2.5.2/contrib/init.d/pbs_server +--- torque-2.5.2.ORIG/contrib/init.d/pbs_server 2010-10-14 22:16:32.978386147 +0200 ++++ torque-2.5.2/contrib/init.d/pbs_server 2010-10-14 23:01:59.911917744 +0200 +@@ -25,11 +25,29 @@ + then + daemon $PBS_DAEMON -d $PBS_HOME + else ++ echo -n "use \"service pbs_server create\"" && failure && echo && exit 5 ++ fi ++ RET=$? ++ [ $RET -eq 0 ] && touch /var/lock/subsys/pbs_server ++ echo ++ ;; ++ create) ++ echo -n "Creating Torque Server Database:... " ++ if [ -r $PBS_HOME/server_priv/serverdb ] ++ then ++ echo -n "serverdb file allready exists?" && failure && echo && exit 5 ++ else + daemon $PBS_DAEMON -t create -d $PBS_HOME + fi + RET=$? + [ $RET -eq 0 ] && touch /var/lock/subsys/pbs_server + echo ++ sleep 3 ++ echo -n "Shutting down TORQUE Server: " ++ killproc pbs_server ++ RET=$? ++ rm -f /var/lock/subsys/pbs_server ++ echo + ;; + stop) + echo -n "Shutting down TORQUE Server: " +@@ -53,7 +71,7 @@ + echo + ;; + *) +- echo "Usage: pbs_server {start|stop|restart|status|reload}" ++ echo "Usage: pbs_server {start|stop|restart|status|reload|create}" + exit 1 + esac + exit $RET diff --git a/torque.spec b/torque.spec index 53c30ac..a25f302 100644 --- a/torque.spec +++ b/torque.spec @@ -68,7 +68,7 @@ Name: torque Version: 2.5.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Tera-scale Open-source Resource and QUEue manager Source0: http://www.clusterresources.com/downloads/%{name}/%{name}-%{version}.tar.gz Source2: xpbs.desktop @@ -80,6 +80,8 @@ Source7: pbs-config-multilib Source8: config # https://bugzilla.redhat.com/show_bug.cgi?id=528060 Patch0: torque-cond-touch.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=631256 +Patch1: torque-create-request.patch License: OpenPBS Group: System Environment/Daemons URL: http://www.clusterresources.com/products/torque/ @@ -267,6 +269,7 @@ This package holds the server. %prep %setup -q %patch0 -p1 +%patch1 -p1 install -pm 644 %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} \ %{SOURCE6} %{SOURCE7} %{SOURCE8} . # rm x bit on some documentation. @@ -648,6 +651,9 @@ fi %changelog +* Thu Oct 14 2010 Steve Traylen - 2.5.2-3 +- rhbz#631256 Only create db if asked to. + * Thu Oct 14 2010 Steve Traylen - 2.5.2-2 - rhbz#58060, add torque-cond-touch.spec to only touch files when service actually starts.