blob: c2f2266f3285b415982ed6663d6fcb7576a386b1 (
plain)
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
83
84
85
|
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openpbs/files/pbs.rc,v 1.3 2004/03/06 04:10:29 vapier Exp $
depend() {
need net
}
checkconfig() {
HOSTNAME=`hostname`
if [ ! -e /var/spool/PBS/server_name ] ; then
eerror "Missing config file /var/spool/PBS/server_name"
return 1
else
PBS_SERVER_NAME=`cat /var/spool/PBS/server_name`
if [ ${HOSTNAME} == ${PBS_SERVER_NAME} ] ; then
PBS_START_SERVER=1;
else
PBS_START_SERVER=0;
fi
fi
if [ ! -e /var/spool/PBS/mom_priv/config ] ; then
eerror "Missing config file /var/spool/PBS/mom_priv/config"
return 1
else
PBS_START_MOM=1;
fi
if [ "${PBS_START_SERVER}" -eq 1 ] ; then
if [ ! -e /var/spool/PBS/server_priv/nodes ] ; then
eerror "The startup script has detected this node is a server"
eerror "from the file /var/spool/PBS/server_name,"
eerror "but the config file /var/spool/PBS/server_priv/nodes is missing"
return 1
fi
fi
}
start() {
checkconfig || return 1
if [ "${PBS_START_MOM}" -gt 0 ] ; then
ebegin "Starting pbs_mom"
start-stop-daemon --start --pidfile /var/spool/PBS/mom_priv/mom.lock \
--startas /usr/sbin/pbs_mom
fi
if [ "${PBS_START_SERVER}" -gt 0 ] ; then
ebegin "Starting pbs_server"
start-stop-daemon --start --quiet --pidfile /var/spool/PBS/server_priv/server.lock \
--startas /usr/sbin/pbs_server
ebegin "Starting pbs_sched"
start-stop-daemon --start --quiet --pidfile /var/run/pbs_sched.pid \
--startas /usr/sbin/pbs_sched
fi
eend $?
}
stop() {
if [ -e /var/spool/PBS/mom_priv/mom.lock ] ; then
ebegin "Stopping pbs_mom"
start-stop-daemon --stop --pidfile /var/spool/PBS/mom_priv/mom.lock
rm -f /var/spool/PBS/mom_priv/mom.lock
fi
if [ -e /var/spool/PBS/server_priv/server.lock ] ; then
ebegin "Stopping pbs_server"
start-stop-daemon --stop --pidfile /var/spool/PBS/server_priv/server.lock
rm -f /var/spool/PBS/server_priv/server.lock
fi
if [ -e /var/spool/PBS/sched_priv/sched.lock ] ; then
ebegin "Stopping pbs_sched"
start-stop-daemon --stop --pidfile /var/spool/PBS/sched_priv/sched.lock
rm -f /var/spool/PBS/sched_priv/sched.lock
fi
eend $?
}
|