]> git.pld-linux.org Git - packages/heimdal.git/blame - heimdal.init
- 1.5.1
[packages/heimdal.git] / heimdal.init
CommitLineData
0527bf4c
AM
1#!/bin/sh
2#
102c9644 3# heimdal Heimdal Kerberos V server daemons
0527bf4c 4#
102c9644 5# chkconfig: 2345 41 41
6#
7# description: Heimdal Kerberos V server daemons
8#
9# processname: kdc
7ec8ef6a 10# config: /etc/krb5.conf
102c9644 11
0527bf4c 12
102c9644 13# Source function library
0527bf4c
AM
14. /etc/rc.d/init.d/functions
15
102c9644 16# Get network config
17. /etc/sysconfig/network
18
19# Get service config
20[ -f /etc/sysconfig/heimdal ] && . /etc/sysconfig/heimdal
a0da4df9 21SERVICE_RUN_NICE_LEVEL=${KDC_SERVICE_RUN_NICE_LEVEL:-0}
102c9644 22
23# Check that networking is up.
4a20dc70 24if is_yes "${NETWORKING}"; then
d615b263 25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
4a20dc70 26 msg_network_down "Kerberos KDC"
27 exit 1
28 fi
29else
30 exit 0
aba8b208 31fi
1f51b483 32
19d6cb15 33start() {
46ef86e4
JR
34 local pid
35
102c9644 36 if [ ! -f /var/lock/subsys/heimdal ]; then
b4c63b3a 37 msg_starting "Kerberos KDC"
855c53ae 38 busy
a0da4df9 39 daemon kdc --detach $KDC_PARAMS
22332c16
JR
40 RETVAL=$?
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/heimdal
102c9644 42 else
4a20dc70 43 msg_already_running "Kerberos KDC"
102c9644 44 fi
19d6cb15
JB
45}
46
47stop() {
4a20dc70 48 if [ -f /var/lock/subsys/heimdal ]; then
49 msg_stopping "Kerberos KDC"
50 killproc kdc
51 rm -f /var/lock/subsys/heimdal >/dev/null 2>&1
b4c63b3a 52 else
4a20dc70 53 msg_not_running "Kerberos KDC"
b4c63b3a 54 fi
19d6cb15
JB
55}
56
57condrestart() {
58 if [ -f /var/lock/subsys/heimdal ]; then
59 stop
60 start
61 else
62 msg_not_running "Kerberos KDC"
63 RETVAL=$1
64 fi
65}
66
67RETVAL=0
68# See how we were called.
69case "$1" in
70 start)
71 start
72 ;;
73 stop)
74 stop
0527bf4c 75 ;;
1f1ceb89 76 restart|force-reload)
19d6cb15
JB
77 stop
78 start
79 ;;
80 try-restart)
81 condrestart 0
82 ;;
83 force-reload)
84 condrestart 7
0527bf4c 85 ;;
b4c63b3a 86 status)
855c53ae 87 status kdc
b4c63b3a 88 exit $?
0527bf4c
AM
89 ;;
90 *)
19d6cb15 91 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
1f1ceb89 92 exit 3
0527bf4c
AM
93esac
94
b4c63b3a 95exit $RETVAL
This page took 0.04287 seconds and 4 git commands to generate.