#!/bin/bash
#
# krb5kdc Start and stop the Kerberos 5 servers.
# chkconfig: - 35 65
# description: Kerberos 5 is a trusted third-party authentication system. \
# This script starts and stops the server that Kerberos IV and 5 \
# clients need to connect to in order to obtain credentials.
# processname: krb5kdc
# 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
# Sheel functions to cut down on useless shell instances.
start() {
if [ ! -f /var/kerberos/krb5kdc/principal ] ; then
exit 0
fi
echo -n $"Starting Kerberos 5 KDC: "
daemon /usr/kerberos/sbin/krb5kdc
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/krb5kdc
}
stop() {
echo -n $"Stopping Kerberos 5 KDC: "
killproc krb5kdc
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/krb5kdc
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
restart)
status)
status krb5kdc
condrestart)
if [ -f /var/lock/subsys/krb5kdc ] ; then
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
RETVAL=1
esac
exit $RETVAL