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