Ignore:
Timestamp:
07/08/07 22:58:56 (17 years ago)
Author:
bastiaans
Message:

Makefile:

  • updated rpm-jobmond

jobmond/jobmond.py:

  • fix to pidfile arg parsing
  • fix to native gmetric unit handling

pkg/rpm/init.d/jobmond:

  • updated as a proper redhat based init script

pkg/rpm/jobmonarch-jobmond.spec:

  • call chkconfig in preun not postun
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pkg/rpm/init.d/jobmond

    r429 r431  
    1 #! /bin/sh
     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
    212
    3 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    4 DAEMON=/usr/bin/jobmond
    5 NAME=jobmond
    6 DESC="Job Monitor Daemon"
     13# Source function library.
     14. /etc/rc.d/init.d/functions
    715
    8 test -x $DAEMON || exit 0
     16RETVAL=0
     17name=jobmond
     18prog=/usr/sbin/jobmond
     19desc="Job Monitoring Daemon"
    920
    10 set -e
     21if [ -r /etc/sysconfig/$name ]; then
     22        source /etc/sysconfig/$name
     23fi
     24
     25start() {
     26        echo -n $"Starting $desc: "
     27        daemon $prog $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}
    1147
    1248case "$1" in
    13   start)
    14         echo -n "Starting $DESC: "
    15         start-stop-daemon --start --quiet -m --pidfile /var/run/$NAME.pid \
    16                 --exec $DAEMON
    17         echo "$NAME."
    18         ;;
    19   stop)
    20         echo -n "Stopping $DESC: "
    21         start-stop-daemon --stop  --quiet --oknodo --name $DAEMON \
    22                 2>&1 > /dev/null
    23         echo "$NAME."
    24         ;;
    25   restart|force-reload)
    26         $0 stop
    27         $0 start
    28         ;;
    29   *)
    30         echo "Usage: $N {start|stop|restart}" >&2
    31         exit 1
    32         ;;
     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
    3369esac
    3470
    35 exit 0
     71exit $RETVAL
Note: See TracChangeset for help on using the changeset viewer.