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

Last change on this file since 437 was 437, checked in by bastiaans, 15 years ago
  • more pkg fixes
  • Property svn:executable set to *
File size: 1.1 KB
RevLine 
[431]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
[378]12
[431]13# Source function library.
14. /etc/rc.d/init.d/functions
[378]15
[431]16RETVAL=0
17name=jobmond
18prog=/usr/sbin/jobmond
19desc="Job Monitoring Daemon"
[378]20
[437]21OPTIONS=""
22
[431]23if [ -r /etc/sysconfig/$name ]; then
24        source /etc/sysconfig/$name
25fi
[378]26
[431]27start() {
28        echo -n $"Starting $desc: "
[432]29        daemon $prog -p /var/run/$name.pid $OPTIONS
[431]30        RETVAL=$?
31        echo
32        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
33        return $RETVAL
34}
35
36stop() {
37        echo -n $"Stopping $desc: "
38        killproc $prog
39        RETVAL=$?
40        echo
41        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
42        return $RETVAL
43}
44
45restart() {
46        stop
47        start
48}
49
[378]50case "$1" in
[431]51        start)
52                start
53                ;;
54        stop)
55                stop
56                ;;
57        restart)
58                restart
59                ;;
60        condrestart)
61                [ -e /var/lock/subsys/$name ] && restart
62                RETVAL=$?
63                ;;
64        status)
65                status python
66                RETVAL=$?
67                ;;
68        *)
69                echo $"Usage: $0 {start|stop|restart|condrestart|status}"
70                RETVAL=1
[378]71esac
72
[431]73exit $RETVAL
Note: See TracBrowser for help on using the repository browser.