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