Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
#!/bin/sh
2
#
3
# certmonger monitors certificates for impending expiration and can
4
# attempt to re-enroll when they expire
5
#
6
# chkconfig: 345 99 01
7
# description: Provides certificate monitoring and PKI enrollment.
8
# processname: /usr/sbin/certmonger
9
# pidfile: /var/run/certmonger.pid
10
#
11
 
12
### BEGIN INIT INFO
13
# Provides: certmonger
14
# Required-Start: messagebus
15
# Required-Stop: messagebus
16
# Should-Start: $network
17
# Should-Stop: $network
18
# Short-Description: Certificate monitor and PKI enrollment client
19
# Description: Provides certificate monitoring and PKI enrollment.
20
### END INIT INFO
21
 
22
program=/usr/sbin/certmonger
23
prog=${program##*/}
24
pidfile=/var/run/certmonger.pid
25
lockfile=/var/lock/subsys/certmonger
26
 
27
if [ -f /etc/rc.d/init.d/functions ]; then
28
        . /etc/rc.d/init.d/functions
29
fi
30
if [ -f /etc/sysconfig/certmonger ]; then
31
        . /etc/sysconfig/certmonger
32
fi
33
 
34
RETVAL=0
35
 
36
start() {
37
    echo -n $"Starting $prog: "
38
    [ -x $program ] || exit 5
39
    daemon $program -S -p ${pidfile} $OPTS
40
    RETVAL=$?
41
    echo
42
    [ $RETVAL -eq 0 ] && touch $lockfile
43
    return $RETVAL
44
}
45
 
46
stop() {
47
    echo -n $"Stopping $prog: "
48
    killproc $program
49
    RETVAL=$?
50
    echo
51
    if [ $RETVAL -eq 0 ]; then
52
        rm -f $lockfile
53
    fi
54
}
55
 
56
mystatusq() {
57
    status $program > /dev/null 2> /dev/null
58
}
59
 
60
restart() {
61
    stop
62
    start
63
}
64
 
65
# See how we were called.
66
case "$1" in
67
    start)
68
        if mystatusq ; then
69
            touch $lockfile
70
            exit 0
71
        fi
72
        $1
73
        ;;
74
    stop)
75
        if ! test -f $pidfile ; then
76
            mystatusq || exit 0
77
        fi
78
        $1
79
        ;;
80
    restart)
81
        $1
82
        ;;
83
    status)
84
        status -p $pidfile $program
85
        RETVAL=$?
86
        ;;
87
    condrestart|try-restart)
88
        [ -f $lockfile ] && restart || :
89
        ;;
90
    reload)
91
        echo "can't reload configuration, you have to restart it"
92
        RETVAL=3
93
        ;;
94
    force-reload)
95
        restart
96
        ;;
97
    *)
98
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
99
        exit 2
100
        ;;
101
esac
102
exit $RETVAL