5af5b2
#!/bin/bash
5af5b2
#
5af5b2
# kpropd.init  Start and stop the Kerberos 5 propagation client.
5af5b2
#
5af5b2
# chkconfig:   - 35 65
5af5b2
# description: Kerberos 5 is a trusted third-party authentication system.  \
5af5b2
#	       This script starts and stops the service that allows this \
5af5b2
#              KDC to receive updates from your master KDC.
5af5b2
# processname: kpropd
5af5b2
#
5af5b2
5af5b2
### BEGIN INIT INFO
5af5b2
# Provides: kprop
5af5b2
# Required-Start: $local_fs $network
5af5b2
# Required-Stop: $local_fs $network
5af5b2
# Should-Start: portreserve
5af5b2
# Default-Start:
5af5b2
# Default-Stop: 0 1 2 3 4 5 6
5af5b2
# Short-Description: start and stop the Kerberos 5 propagation client
5af5b2
# Description: The kpropd service accepts database updates pushed to it from \
5af5b2
#              the master KDC.  It will never be needed on a master KDC.
5af5b2
### END INIT INFO
5af5b2
5af5b2
# Get config.
5af5b2
. /etc/sysconfig/network
5af5b2
5af5b2
# Source function library.
5af5b2
. /etc/init.d/functions
5af5b2
5af5b2
RETVAL=0
5af5b2
prog="Kerberos 5 Propagation Server"
5af5b2
kpropd=/usr/sbin/kpropd
5af5b2
5af5b2
# Shell functions to cut down on useless shell instances.
5af5b2
start() {
5af5b2
  	[ -f /var/kerberos/krb5kdc/kpropd.acl ] || exit 6
5af5b2
	[ -x $kpropd ] || exit 5
5af5b2
	echo -n $"Starting $prog: "
5af5b2
	# tell portreserve to release the krb5_prop port
5af5b2
	[ -x /sbin/portrelease ] && /sbin/portrelease krb5_prop &>/dev/null || :
5af5b2
	daemon ${kpropd} -S
5af5b2
	RETVAL=$?
5af5b2
	echo
5af5b2
	if test $RETVAL -ne 0 ; then
5af5b2
	    if status -l kprop ${kpropd} > /dev/null ; then
5af5b2
		RETVAL=0
5af5b2
	    fi
5af5b2
	fi
5af5b2
	[ $RETVAL = 0 ] && touch /var/lock/subsys/kprop
5af5b2
}
5af5b2
stop() {
5af5b2
	echo -n $"Stopping $prog: "
5af5b2
	killproc ${kpropd}
5af5b2
	RETVAL=$?
5af5b2
	echo
5af5b2
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/kprop
5af5b2
}
5af5b2
5af5b2
# See how we were called.
5af5b2
case "$1" in
5af5b2
  start)
5af5b2
	start
5af5b2
	;;
5af5b2
  stop)
5af5b2
	stop
5af5b2
	;;
5af5b2
  # We don't really "do" reload, so treat it as a restart.
5af5b2
  restart|force-reload)
5af5b2
	stop
5af5b2
	start
5af5b2
	;;
5af5b2
  reload)
5af5b2
	echo "can't reload configuration, you have to restart it"
5af5b2
	RETVAL=3
5af5b2
	;;
5af5b2
  status)
5af5b2
	status -l kprop ${kpropd}
5af5b2
	RETVAL=$?
5af5b2
	;;
5af5b2
  condrestart)
5af5b2
	if [ -f /var/lock/subsys/kprop ] ; then
5af5b2
		stop
5af5b2
		start
5af5b2
	fi
5af5b2
	;;
5af5b2
  *)
5af5b2
	echo $"Usage: $0 {start|stop|restart|condrestart|reload|status|force-reload}"
5af5b2
	RETVAL=2
5af5b2
	;;
5af5b2
esac
5af5b2
5af5b2
exit $RETVAL