cvsdist 0bb98ee
#!/bin/bash
cvsdist af3b546
#
cvsdist af3b546
# krb524       Start and stop the krb524 service.
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 krb524d, which converts \
cvsdist af3b546
#              Kerberos 5 credentials to Kerberos IV credentials.
cvsdist af3b546
# processname: krb524d
c22df5b
# config: /etc/sysconfig/krb524
cvsdist af3b546
#
cvsdist af3b546
cvsdist af3b546
# Get config.
cvsdist af3b546
. /etc/sysconfig/network
cvsdist af3b546
708fedd
# Get config.
708fedd
[ -r /etc/sysconfig/krb524 ] && . /etc/sysconfig/krb524
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-to-4 Server"
cvsdist 21f3145
krb524d=/usr/kerberos/sbin/krb524d
cvsdist af3b546
cvsdist 68d4ec4
# Shell functions to cut down on unnecessary shell invocations.
cvsdist af3b546
start() {
cvsdist af3b546
  	if [ ! -f /var/kerberos/krb5kdc/principal ] ; then
f072055
	    # Make an educated guess -- if they're using kldap somewhere,
f072055
	    # then we don't know for sure that this is an error.
f072055
  	    if ! grep -q 'db_library.*=.*kldap' /etc/krb5.conf ; then
f072055
	        echo $"Error. Default principal database does not exist."
f072055
	        exit 6
f072055
	    fi
cvsdist af3b546
	fi
f072055
	[ -x $krb524d ] || exit 5
cvsdist 21f3145
	echo -n $"Starting $prog: "
708fedd
	daemon ${krb524d} ${KRB524D_ARGS:--m}
cvsdist af3b546
	RETVAL=$?
cvsdist af3b546
	echo
cvsdist af3b546
	[ $RETVAL = 0 ] && touch /var/lock/subsys/krb524
cvsdist af3b546
}
cvsdist af3b546
stop() {
cvsdist 21f3145
	echo -n $"Stopping $prog: "
cvsdist 21f3145
	killproc ${krb524d}
cvsdist af3b546
	RETVAL=$?
cvsdist af3b546
	echo
cvsdist af3b546
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/krb524
cvsdist af3b546
}
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 af3b546
  status)
cvsdist 21f3145
	status ${krb524d}
cvsdist af3b546
	;;
cvsdist af3b546
  condrestart)
cvsdist af3b546
	if [ -f /var/lock/subsys/krb524 ] ; then
cvsdist af3b546
		stop
cvsdist af3b546
		start
cvsdist af3b546
	fi
cvsdist af3b546
	;;
cvsdist af3b546
  *)
cvsdist 0bb98ee
	echo $"Usage: $0 {start|stop|status|restart|condrestart}"
f072055
	RETVAL=2
cvsdist af3b546
	;;
cvsdist af3b546
esac
cvsdist af3b546
cvsdist af3b546
exit $RETVAL