source: trunk/pkg/rpm/init.d/jobarchived

Last change on this file was 483, checked in by bastiaans, 16 years ago

rpm/init.d/*:

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