summaryrefslogtreecommitdiff
blob: d8072c07c785d4bcd59d88d49ab4c8bbbcb0607c (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
#!/sbin/runscript

#---------------------------------------------------------------------------
# This script starts/stops the following
#	 krb5kdc
#	 kadmind
#---------------------------------------------------------------------------
#
# NB: Config is in /etc/krb5.conf
#     KRB5_KDC set in /etc/conf.d/krb5
#     KRB5_KDC_MASTER set in /etc/conf.d/krb5
#

opts="start stop restart"


depend() {
	need net 
}


start() {
	if [ -f /etc/krb5.conf ]
	then
	    if [ -n "$KRB5_KDC$KRB5_KDC_MASTER" ]; then
	        daemon="Kerberos 5 KDC"
	        ebegin "Starting $daemon"
	        start-stop-daemon --start --quiet --exec /usr/sbin/krb5kdc 1>&2
	        eend $? "Error starting $daemon"
	    fi

	    if [ -n "$KRB5_KDC_MASTER" ]; then
            daemon="Kerberos 5 Admin daemon"	
	        ebegin "Starting $daemon"
	        start-stop-daemon --start --quiet --exec /usr/sbin/kadmind 1>&2
	        eend $? "Error starting $daemon"
	    fi
	fi
}

stop() { 
    if [ -n "$KRB5_KDC$KRB5_KDC_MASTER" ]; then
        daemon="Kerberos 5 KDC"
        ebegin "Stopping $daemon"
        start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/krb5kdc 1>&2
        eend $? "Error stopping $daemon"
    fi

    if [ -n "$KRB5_KDC_MASTER" ]; then
        daemon="Kerberos 5 Admin daemon"	
        ebegin "Stopping $daemon"
        start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/kadmind 1>&2
        eend $? "Error stopping $daemon"
    fi
}

restart() {
   svc_stop
   svc_start
}