diff options
| author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-04-01 23:34:52 -0400 |
|---|---|---|
| committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-04-01 23:34:52 -0400 |
| commit | 9642941ee8b264c03741cc4dfa4e9db88df977cc (patch) | |
| tree | e3ba271cf9228a7892c9db487250bf33494a6746 /src/credmonger.init | |
| parent | 982ac3633f70287774eef35e5e6025de7dff4728 (diff) | |
| download | credmonger-9642941ee8b264c03741cc4dfa4e9db88df977cc.tar.gz credmonger-9642941ee8b264c03741cc4dfa4e9db88df977cc.tar.xz credmonger-9642941ee8b264c03741cc4dfa4e9db88df977cc.zip | |
- add some license text
- add an init script
Diffstat (limited to 'src/credmonger.init')
| -rwxr-xr-x | src/credmonger.init | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/credmonger.init b/src/credmonger.init new file mode 100755 index 0000000..a4b417a --- /dev/null +++ b/src/credmonger.init @@ -0,0 +1,94 @@ +#!/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: Starts the Name Switch Cache Daemon +# 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 +prog=credmonger + +start () { + echo -n $"Starting $prog: " + daemon /usr/sbin/$prog -p /var/run/credmonger.pid + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/credmonger + return $RETVAL +} + +stop () { + echo -n $"Stopping $prog: " + killproc /usr/sbin/$prog + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + rm -f /var/run/credmonger.pid + 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 /var/lock/subsys/credmonger ] && restart + RETVAL=$? + ;; + force-reload | reload) + echo -n $"Reloading $prog: " + RETVAL=0 + killproc -HUP /usr/sbin/$prog + echo + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" + RETVAL=1 + ;; +esac +exit $RETVAL |
