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 | |
parent | 982ac3633f70287774eef35e5e6025de7dff4728 (diff) | |
download | credmonger-9642941ee8b264c03741cc4dfa4e9db88df977cc.tar.gz credmonger-9642941ee8b264c03741cc4dfa4e9db88df977cc.tar.xz credmonger-9642941ee8b264c03741cc4dfa4e9db88df977cc.zip |
- add some license text
- add an init script
-rw-r--r-- | LICENSE | 27 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/credmonger.c | 28 | ||||
-rwxr-xr-x | src/credmonger.init | 94 |
4 files changed, 150 insertions, 0 deletions
@@ -0,0 +1,27 @@ +/* + * Copyright 2009 Red Hat, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ diff --git a/src/Makefile.am b/src/Makefile.am index 8214567..9932989 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,5 @@ AM_CFLAGS = @KRB5_CFLAGS@ LDFLAGS = @KRB5_LIBS@ sbin_PROGRAMS = credmonger +man_MANS = credmonger.8 credmonger_SOURCES = credmonger.c diff --git a/src/credmonger.c b/src/credmonger.c index bbd05e8..488e3a6 100644 --- a/src/credmonger.c +++ b/src/credmonger.c @@ -1,3 +1,31 @@ +/* + * Copyright 2009 Red Hat, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, and the entire permission notice in its entirety, + * including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif 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 |