#!/bin/bash # # credmonger: maintain Kerberos credentials for other processes # # chkconfig: - 18 86 # description: This is a daemon which handles obtaining and refreshing \ # Kerberos credentials on behalf of other processes which \ # may unknowingly require such credentials to function \ # properly in your environment. # processname: /usr/sbin/credmonger # pidfile: /var/run/credmonger.pid # ### BEGIN INIT INFO # Provides: credmonger # Required-Start: $syslog # Default-Stop: 0 1 6 # Short-Description: maintain Kerberos credentials for other processes # Description: This is a daemon which handles obtaining and refreshing \ # Kerberos credentials on behalf of other processes which \ # may unknowingly require such credentials to function \ # properly in your environment. ### END INIT INFO # Source function library. . /etc/init.d/functions # Source an auxiliary options file if we have one, and pick up whatever it has. [ -r /etc/sysconfig/credmonger ] && . /etc/sysconfig/credmonger RETVAL=0 program=/usr/sbin/credmonger prog=${program##*/} pidfile=/var/run/credmonger.pid lockfile=/var/lock/subsys/credmonger start () { echo -n $"Starting $prog: " daemon ${program} -p ${pidfile} RETVAL=$? echo [ $RETVAL -eq 0 ] && touch ${lockfile} return $RETVAL } stop () { echo -n $"Stopping $prog: " killproc -p ${pidfile} ${program} RETVAL=$? if [ $RETVAL -eq 0 ]; then rm -f ${lockfile} success $"$prog shutdown" else failure $"$prog shutdown" fi echo return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; status) status $prog RETVAL=$? ;; restart) restart RETVAL=$? ;; condrestart) [ -e ${lockfile} ] && restart RETVAL=$? ;; force-reload|reload) echo -n $"Reloading $prog: " killproc -p ${pidfile} ${program} -HUP RETVAL=0 echo ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" RETVAL=1 ;; esac exit $RETVAL