3
# Provides: krb5-admin-server
4
# Required-Start: $local_fs $remote_fs $network $syslog
5
# Required-Stop: $local_fs $remote_fs $network $syslog
6
# Should-Start: krb5-kdc
7
# Should-Stop: krb5-kdc
8
# Default-Start: 2 3 4 5
10
# Short-Description: MIT Kerberos KDC administrative daemon
11
# Description: Starts, stops, or restarts the MIT Kerberos KDC
12
# administrative daemon (kadmind). This daemon answers
13
# requests from kadmin clients and allows administrators
14
# to create, delete, and modify principals in the KDC
18
# Author: Sam Hartman <hartmans@mit.edu>
19
# Author: Russ Allbery <rra@debian.org>
21
# Based on the /etc/init.d/skeleton template as found in initscripts version
24
PATH=/usr/sbin:/usr/bin:/sbin:/bin
25
DESC="Kerberos administrative servers"
27
DAEMON=/usr/sbin/$NAME
29
PIDFILE=/var/run/$NAME.pid
30
SCRIPTNAME=/etc/init.d/krb5-admin-server
31
DEFAULT=/etc/default/krb5-admin-server
33
# Exit if the package is not installed.
34
[ -x "$DAEMON" ] || exit 0
36
# Read configuration if it is present.
37
[ -r "$DEFAULT" ] && . "$DEFAULT"
39
# Get the setting of VERBOSE and other rcS variables.
40
[ -f /etc/default/rcS ] && . /etc/default/rcS
42
# Define LSB log functions (requires lsb-base >= 3.0-6).
43
. /lib/lsb/init-functions
46
# 0 if daemon has been started
47
# 1 if daemon was already running
48
# 2 if daemon could not be started
51
start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --name $NAME --test \
52
> /dev/null || return 1
53
start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --name $NAME \
54
-- -P $PIDFILE $DAEMON_ARGS || return 2
58
# 0 if daemon has been stopped
59
# 1 if daemon was already stopped
60
# 2 if daemon could not be stopped
61
# other if a failure occurred
64
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
66
[ "$RETVAL" = 2 ] && return 2
74
if [ "$RUN_KADMIND" = false ] ; then
75
if [ "$VERBOSE" != no ] ; then
76
log_action_msg "Not starting $DESC per configuration"
80
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
83
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
84
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
89
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
92
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
93
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
98
if [ "$RUN_KADMIND" = false ] ; then
99
if [ "$VERBOSE" != no ] ; then
100
log_action_msg "Not restarting $DESC per configuration"
104
log_daemon_msg "Restarting $DESC" "$NAME"
110
0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
111
*) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
121
status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
125
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2