GCCluster: suse.pbs_server

File suse.pbs_server, 1.7 KB (added by Pieter Neerincx, 12 years ago)

/etc/init.d/ script for pbs_server

Line 
1#!/bin/sh
2#
3# pbs_server    This script will start and stop the PBS Server
4#
5### BEGIN INIT INFO
6# Provides:       pbs_server
7# Required-Start: $syslog $remote_fs
8# Should-Start:
9# Required-Stop:  $syslog $remote_fs
10# Should-Stop:    $null
11# Default-Start:  3 4 5
12# Default-Stop:   0 1 2 6
13# Short-Description: Torque server
14# Description: Torque is a versatile batch system for SMPs and clusters.
15#       Starts the PBS batch server, which operates as batch server
16#       on the local host.
17### END INIT INFO
18
19PBS_DAEMON=/usr/local/sbin/pbs_server
20PBS_HOME=/var/spool/torque
21PIDFILE=$PBS_HOME/server_priv/server.lock
22export PBS_DAEMON PBS_HOME PIDFILE
23
24# Source the library functions
25. /etc/rc.status
26rc_reset
27
28[ -f /etc/sysconfig/pbs_server ] && . /etc/sysconfig/pbs_server
29[ -x $PBS_DAEMON ] || exit
30
31
32# let see how we were called
33case "$1" in
34        start)
35                echo -n "Starting TORQUE Server: "
36#               if [ -r $PBS_HOME/server_priv/serverdb ]
37#               then
38# Commented out by dbeer. This if check (and -t create possibility) will blow
39# away the serverdb file if $TORQUE_HOME isn't the default
40                        startproc $PBS_DAEMON $SERVER_ARGS
41#               else
42#                       startproc $PBS_DAEMON -t create $DAEMON_ARGS
43#               fi
44                rc_status -v
45                ;;
46        stop)
47                echo -n "Shutting down TORQUE Server: "
48                killproc -p $PIDFILE $PBS_DAEMON
49                rc_status -v
50                ;;
51        status)
52                echo -n "Checking TORQUE Server: "
53                checkproc -p $PIDFILE pbs_server
54                rc_status -v
55                ;;
56        restart)
57                $0 stop
58                $0 start
59                rc_status
60                ;;
61        try-restart)
62                $0 status >/dev/null && $0 restart
63                rc_status
64                ;;
65        reload|force-reload)
66                echo -n "Reloading TORQUE Server: "
67                killproc -p $PIDFILE pbs_server -HUP
68                rc_status -v
69                ;;
70        *)
71                echo "Usage: pbs_server {start|stop|status|try-restart|restart|force-reload|reload}"
72                exit 1
73esac
74rc_exit