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

Last change on this file since 435 was 435, checked in by bastiaans, 17 years ago

jobarchived/jobarchived.py:

  • added pidfile support

pkg/rpm/init.d/jobarchived,
pkg/rpm/jobmonarch-jobarchived.spec,
Makefile:

  • updated
  • Property svn:executable set to *
File size: 1.1 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
17name=jobarchived
18prog=/usr/sbin/jobarchived
19desc="Job Archiving Daemon"
[378]20
[435]21if [ -r /etc/sysconfig/$name ]; then
22        source /etc/sysconfig/$name
23fi
[378]24
[435]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}
[378]33
[435]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
[378]48case "$1" in
[435]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
[378]69esac
70
[435]71exit $RETVAL
Note: See TracBrowser for help on using the repository browser.