Last change
on this file since 953 was
483,
checked in by bastiaans, 16 years ago
|
rpm/init.d/*:
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # |
---|
3 | # Init file for the Job Monitoring Daemon |
---|
4 | # |
---|
5 | # chkconfig: 2345 20 80 |
---|
6 | # description: jobmond reports information on batch jobs as Ganglia metrics |
---|
7 | # |
---|
8 | # processname: jobmond |
---|
9 | # config: /etc/jobmond.conf |
---|
10 | # config: /etc/sysconfig/jobmond |
---|
11 | # pidfile: /var/run/jobmond |
---|
12 | |
---|
13 | # Source function library. |
---|
14 | . /etc/rc.d/init.d/functions |
---|
15 | |
---|
16 | RETVAL=0 |
---|
17 | NAME=jobmond |
---|
18 | DAEMON=/usr/sbin/jobmond |
---|
19 | DESC="Job Monitoring Daemon" |
---|
20 | |
---|
21 | PIDFILE=/var/run/$NAME.pid |
---|
22 | OPTIONS="" |
---|
23 | |
---|
24 | if [ -r /etc/sysconfig/$name ] |
---|
25 | then |
---|
26 | source /etc/sysconfig/$NAME |
---|
27 | fi |
---|
28 | |
---|
29 | start() { |
---|
30 | echo -n $"Starting $DESC: " |
---|
31 | daemon $DAEMON --pidfile="$PIDFILE" $OPTIONS |
---|
32 | RETVAL=$? |
---|
33 | echo |
---|
34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME |
---|
35 | return $RETVAL |
---|
36 | } |
---|
37 | |
---|
38 | stop() { |
---|
39 | echo -n $"Stopping $DESC: " |
---|
40 | killproc $DAEMON |
---|
41 | RETVAL=$? |
---|
42 | echo |
---|
43 | rm -f $PIDFILE |
---|
44 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME |
---|
45 | return $RETVAL |
---|
46 | } |
---|
47 | |
---|
48 | restart() { |
---|
49 | stop |
---|
50 | start |
---|
51 | } |
---|
52 | |
---|
53 | case "$1" in |
---|
54 | start) |
---|
55 | start |
---|
56 | ;; |
---|
57 | stop) |
---|
58 | stop |
---|
59 | ;; |
---|
60 | restart) |
---|
61 | restart |
---|
62 | ;; |
---|
63 | condrestart) |
---|
64 | [ -e /var/lock/subsys/$NAME ] && restart |
---|
65 | RETVAL=$? |
---|
66 | ;; |
---|
67 | status) |
---|
68 | status python |
---|
69 | RETVAL=$? |
---|
70 | ;; |
---|
71 | *) |
---|
72 | echo $"Usage: $0 {start|stop|restart|condrestart|status}" |
---|
73 | RETVAL=1 |
---|
74 | esac |
---|
75 | |
---|
76 | exit $RETVAL |
---|
Note: See
TracBrowser
for help on using the repository browser.