torque_install/torque/contrib/init.d/suse.pbs_server.in
ruoyunbai 2bb9621e30 1
2021-09-29 21:06:16 +08:00

82 lines
1.9 KiB
Bash

#!/bin/sh
#
# pbs_server This script will start and stop the PBS Server
#
### BEGIN INIT INFO
# Provides: pbs_server
# Required-Start: $syslog $remote_fs
# Should-Start:
# Required-Stop: $syslog $remote_fs
# Should-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: Torque server
# Description: Torque is a versatile batch system for SMPs and clusters.
# Starts the PBS batch server, which operates as batch server
# on the local host.
### END INIT INFO
PBS_DAEMON=@sbindir@/pbs_server
PBS_BIN_DIR=@bindir@
PBS_HOME=@PBS_HOME@
PIDFILE=$PBS_HOME/server_priv/server.lock
export PBS_DAEMON PBS_HOME PIDFILE
# Source the library functions
. /etc/rc.status
rc_reset
[ -f /etc/sysconfig/pbs_server ] && . /etc/sysconfig/pbs_server
[ -x $PBS_DAEMON ] || exit
# let see how we were called
case "$1" in
start)
echo -n "Starting TORQUE Server: "
# if [ -r $PBS_HOME/server_priv/serverdb ]
# then
# Commented out by dbeer. This if check (and -t create possibility) will blow
# away the serverdb file if $TORQUE_HOME isn't the default
startproc $PBS_DAEMON $SERVER_ARGS
# else
# startproc $PBS_DAEMON -t create $DAEMON_ARGS
# fi
rc_status -v
;;
stop)
echo -n "Shutting down TORQUE Server: "
pid=`pidof -s $PBS_DAEMON`
# use SIGTERM not qterm to stop local pbs_server
# note that qterm will halt the master pbs_server which
# may be running on a different note in HA mode.
if [ $? -eq 0 ]; then
kill -TERM $pid
fi
rc_status -v
;;
status)
echo -n "Checking TORQUE Server: "
checkproc -p $PIDFILE pbs_server
rc_status -v
;;
restart)
$0 stop
$0 start
rc_status
;;
try-restart)
$0 status >/dev/null && $0 restart
rc_status
;;
reload|force-reload)
echo -n "Reloading TORQUE Server: "
killproc -p $PIDFILE pbs_server -HUP
rc_status -v
;;
*)
echo "Usage: pbs_server {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
esac
rc_exit