summaryrefslogtreecommitdiffstats
path: root/krb524d.init
blob: 05e3752fc44e5a115058ee4513faf9d94bd5e5c7 (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
#!/bin/bash
#
# krb524       Start and stop the krb524 service.
#
# chkconfig:   - 35 65
# description: Kerberos 5 is a trusted third-party authentication system.  \
#	       This script starts and stops krb524d, which converts \
#              Kerberos 5 credentials to Kerberos IV credentials.
# processname: krb524d
#

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

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

RETVAL=0
prog="Kerberos 5-to-4 Server"
krb524d=/usr/kerberos/sbin/krb524d

# Shell functions to cut down on unnecessary shell invocations.
start() {
  	if [ ! -f /var/kerberos/krb5kdc/principal ] ; then
	    exit 0
	fi
	echo -n $"Starting $prog: "
	daemon ${krb524d} -m
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && touch /var/lock/subsys/krb524
}
stop() {
	echo -n $"Stopping $prog: "
	killproc ${krb524d}
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/krb524
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart)
	stop
	start
	;;
  status)
	status ${krb524d}
	;;
  condrestart)
	if [ -f /var/lock/subsys/krb524 ] ; then
		stop
		start
	fi
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|condrestart}"
	RETVAL=1
	;;
esac

exit $RETVAL