summaryrefslogtreecommitdiffstats
path: root/src/credmonger.init
blob: 0dd5626a2ae914667ac614e12dd2ec46c4a93ee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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: 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
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