source: trunk/pkg/rpm/init.d/jobmond @ 432

Last change on this file since 432 was 432, checked in by bastiaans, 15 years ago

pkg/rpm/init.d/jobmond:

  • create our own pidfile when startin
  • 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
16RETVAL=0
17name=jobmond
18prog=/usr/sbin/jobmond
19desc="Job Monitoring Daemon"
20
21if [ -r /etc/sysconfig/$name ]; then
22        source /etc/sysconfig/$name
23fi
24
25start() {
26        echo -n $"Starting $desc: "
27        daemon $prog -p /var/run/$name.pid $OPTIONS
28        RETVAL=$?
29        echo
30        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
31        return $RETVAL
32}
33
34stop() {
35        echo -n $"Stopping $desc: "
36        killproc $prog
37        RETVAL=$?
38        echo
39        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
40        return $RETVAL
41}
42
43restart() {
44        stop
45        start
46}
47
48case "$1" in
49        start)
50                start
51                ;;
52        stop)
53                stop
54                ;;
55        restart)
56                restart
57                ;;
58        condrestart)
59                [ -e /var/lock/subsys/$name ] && restart
60                RETVAL=$?
61                ;;
62        status)
63                status python
64                RETVAL=$?
65                ;;
66        *)
67                echo $"Usage: $0 {start|stop|restart|condrestart|status}"
68                RETVAL=1
69esac
70
71exit $RETVAL
Note: See TracBrowser for help on using the repository browser.