summaryrefslogtreecommitdiffstats
path: root/init-scripts/certmaster
blob: 11a4539d7e5e0c646b94cd88b7b2661045fd3445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
#
# certmaster    certmaster
###################################

# LSB header

### BEGIN INIT INFO
# Provides: certmaster
# Required-Start: network
# Short-Description: certificate master for Fedora Unified Network Control 'master server only'
# Description: certificate master to sign/manage ca/cert infrastructure for func
### END INIT INFO

# chkconfig header

# chkconfig: - 98 99 
# description:  certificate master to sign/manage ca/cert infrastructure for func
#
# processname: /usr/bin/certmaster

# Sanity checks.
[ -x /usr/bin/certmaster ] || exit 0

# Source function library.
. /etc/rc.d/init.d/functions

SERVICE=certmaster
PROCESS=certmaster
CONFIG_ARGS=" "

RETVAL=0

start() {
    echo -n $"Starting certmaster daemon: "
    daemon --check $SERVICE $PROCESS --daemon $CONFIG_ARGS
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE
    return $RETVAL
}

stop() {
    echo -n $"Stopping certmaster daemon: "
    killproc $PROCESS
    RETVAL=$?
    echo
    if [ $RETVAL -eq 0 ]; then
	rm -f /var/lock/subsys/$SERVICE
        rm -f /var/run/$SERVICE.pid
    fi
}

restart() {
   stop
   start
}

# See how we were called.
case "$1" in
    start|stop|restart)
        $1
        ;;
    status)
        status $PROCESS
        RETVAL=$?
        ;;
    condrestart)
        [ -f /var/lock/subsys/$SERVICE ] && restart || :
        ;;
    reload)
        echo "can't reload configuration, you have to restart it"
        RETVAL=$?
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
        exit 1
        ;;
esac
exit $RETVAL