cvsdist 0bb98ee
#!/bin/bash
cvsdist af3b546
#
cvsdist af3b546
# krb5kdc      Start and stop the Kerberos 5 servers.
cvsdist af3b546
#
cvsdist af3b546
# chkconfig:   - 35 65
cvsdist af3b546
# description: Kerberos 5 is a trusted third-party authentication system.  \
cvsdist af3b546
#	       This script starts and stops the server that Kerberos IV and 5 \
cvsdist af3b546
#	       clients need to connect to in order to obtain credentials.
cvsdist af3b546
# processname: krb5kdc
c22df5b
# config: /etc/sysconfig/krb5kdc
cvsdist af3b546
#
cvsdist af3b546
cvsdist af3b546
# Get config.
cvsdist af3b546
. /etc/sysconfig/network
cvsdist af3b546
cvsdist af3b546
# Check that networking is up.
cvsdist af3b546
[ ${NETWORKING} = "no" ] && exit 0
cvsdist af3b546
708fedd
# Get config.
708fedd
[ -r /etc/sysconfig/krb5kdc ] && . /etc/sysconfig/krb5kdc
708fedd
cvsdist af3b546
# Source function library.
cvsdist af3b546
. /etc/rc.d/init.d/functions
cvsdist af3b546
cvsdist af3b546
RETVAL=0
cvsdist 21f3145
prog="Kerberos 5 KDC"
cvsdist 21f3145
krb5kdc=/usr/kerberos/sbin/krb5kdc
cvsdist af3b546
cvsdist af3b546
# Sheel functions to cut down on useless shell instances.
cvsdist af3b546
start() {
cvsdist 21f3145
	echo -n $"Starting $prog: "
2e8f6b3
	daemon ${krb5kdc} ${KRB5REALM:+-r ${KRB5REALM}} $KRB5KDC_ARGS
cvsdist af3b546
	RETVAL=$?
cvsdist af3b546
	echo
cvsdist af3b546
	[ $RETVAL = 0 ] && touch /var/lock/subsys/krb5kdc
cvsdist af3b546
}
cvsdist af3b546
stop() {
cvsdist 21f3145
	echo -n $"Stopping $prog: "
cvsdist 21f3145
	killproc ${krb5kdc}
cvsdist af3b546
	RETVAL=$?
cvsdist af3b546
	echo
cvsdist af3b546
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/krb5kdc
cvsdist af3b546
}
cvsdist 21f3145
reload() {
cvsdist 21f3145
	echo -n $"Reopening $prog log file: "
cvsdist 21f3145
	killproc ${krb5kdc} -HUP
cvsdist 21f3145
        RETVAL=$?
cvsdist 21f3145
	echo
cvsdist 21f3145
}
cvsdist af3b546
cvsdist af3b546
# See how we were called.
cvsdist af3b546
case "$1" in
cvsdist af3b546
  start)
cvsdist af3b546
	start
cvsdist af3b546
	;;
cvsdist af3b546
  stop)
cvsdist af3b546
	stop
cvsdist af3b546
	;;
cvsdist af3b546
  restart)
cvsdist af3b546
	stop
cvsdist af3b546
	start
cvsdist af3b546
	;;
cvsdist 21f3145
  reload)
cvsdist 21f3145
        reload
cvsdist 21f3145
        ;;
cvsdist af3b546
  status)
cvsdist 21f3145
	status ${krb5kdc}
cvsdist 21f3145
        RETVAL=$?
cvsdist af3b546
	;;
cvsdist af3b546
  condrestart)
cvsdist af3b546
	if [ -f /var/lock/subsys/krb5kdc ] ; then
cvsdist af3b546
		stop
cvsdist af3b546
		start
cvsdist af3b546
	fi
cvsdist af3b546
	;;
cvsdist af3b546
  *)
cvsdist 21f3145
	echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
cvsdist af3b546
	RETVAL=1
cvsdist af3b546
	;;
cvsdist af3b546
esac
cvsdist af3b546
cvsdist af3b546
exit $RETVAL