torque/torque-create-request.patch

43 lines
1.3 KiB
Diff

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