GCCluster: suse.pbs_mom

File suse.pbs_mom, 1.8 KB (added by Pieter Neerincx, 12 years ago)

/etc/init.d/ script for pbs_mom

Line 
1#!/bin/sh
2#
3# pbs_mom       This script will start and stop the PBS Mom
4#
5### BEGIN INIT INFO
6# Provides:       pbs_mom
7# Required-Start: $syslog $remote_fs gpfs
8# Should-Start:   
9# Required-Stop:  $syslog $remote_fs gpfs
10# Should-Stop:    $null
11# Default-Start:  3 4 5
12# Default-Stop:   0 1 2 6
13# Short-Description: Torque Node Manager Daemon
14# Description: Torque is a versatile batch system for SMPs and clusters.
15#       This starts the operation of a batch Machine Oriented Mini-server,
16#       MOM, on the local host.
17### END INIT INFO
18
19PBS_DAEMON=/usr/local/sbin/pbs_mom
20PBS_HOME=/var/spool/torque
21PIDFILE=$PBS_HOME/mom_priv/mom.lock
22export PBS_DAEMON PBS_HOME PIDFILE
23
24
25ulimit -n 32768
26# Source the library functions
27. /etc/rc.status
28rc_reset
29
30[ -f /etc/sysconfig/pbs_mom ] && . /etc/sysconfig/pbs_mom
31[ -x $PBS_DAEMON ] || exit
32
33args=""
34if [ -z "$PREVLEVEL" ];then
35   # being run manually, don't disturb jobs
36   args="-p"
37else
38   args="-q"
39fi
40
41
42# how were we called
43case "$1" in
44        start)
45                echo -n "Starting TORQUE Mom: "
46                startproc $PBS_DAEMON $args $DAEMON_ARGS
47                rc_status -v
48                ;;
49        purge)
50                [ -f /var/lock/subsys/pbs_mom ] && $0 stop
51                echo -n "Starting TORQUE Mom with purge: "
52                startproc $PBS_DAEMON -r $DAEMON_ARGS
53                rc_status -v
54                ;;
55        stop)
56                echo -n "Shutting down TORQUE Mom: "
57                killproc -p $PIDFILE $PBS_DAEMON
58                rc_status -v
59                ;;
60        status)
61                echo -n "Checking TORQUE Mom: "
62                checkproc -p $PIDFILE $PBS_DAEMON
63                rc_status -v
64                ;;
65        restart)
66                $0 stop
67                sleep 1
68                $0 start
69                rc_status
70                ;;
71        try-restart)
72                $0 status >/dev/null && $0 restart
73                rc_status
74                ;;
75        reload|force-reload)
76                echo -n "Re-reading TORQUE Mom config file: "
77                killproc -p $PIDFILE -HUP pbs_mom
78                rc_status -v
79                ;;
80        *)
81                echo "Usage: pbs_mom {start|stop|status|try-restart|restart|force-reload|reload|purge}"
82                exit 1
83esac
84rc_exit