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
Line 
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
12
13# Source function library.
14. /etc/rc.d/init.d/functions
15
16RETVAL=0
17NAME=jobarchived
18DAEMON=/usr/sbin/jobarchived
19DESC="Job Archiving Daemon"
20
21PIDFILE=/var/run/$NAME.pid
22
23OPTIONS=""
24
25if [ -r /etc/sysconfig/$NAME ]
26        then
27                source /etc/sysconfig/$NAME
28fi
29
30start() {
31        echo -n $"Starting $DESC: "
32        daemon $DAEMON --pidfile="$PIDFILE" $OPTIONS
33        RETVAL=$?
34        echo
35        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
36        return $RETVAL
37}
38
39stop() {
40        echo -n $"Stopping $DESC: "
41        killproc $DAEMON
42        RETVAL=$?
43        echo
44        rm -f $PIDFILE
45        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME
46        return $RETVAL
47}
48
49restart() {
50        stop
51        start
52}
53
54case "$1" in
55        start)
56                start
57                ;;
58        stop)
59                stop
60                ;;
61        restart)
62                restart
63                ;;
64        condrestart)
65                [ -e /var/lock/subsys/$NAME ] && restart
66                RETVAL=$?
67                ;;
68        status)
69                status python
70                RETVAL=$?
71                ;;
72        *)
73                echo $"Usage: $0 {start|stop|restart|condrestart|status}"
74                RETVAL=1
75esac
76
77exit $RETVAL
Note: See TracBrowser for help on using the repository browser.