xref: /freebsd/libexec/rc/rc.d/kdc (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1#!/bin/sh
2#
3#
4
5# PROVIDE: kdc
6# REQUIRE: NETWORKING
7# BEFORE: SERVERS
8# KEYWORD: shutdown
9
10. /etc/rc.subr
11
12name=kdc
13desc="Kerberos 5 server"
14rcvar=${name}_enable
15: ${kdc_restart:="NO"}
16: ${kdc_restart_delay:=""}
17: ${kdc_svcj_options:="net_basic"}
18
19set_rcvar_obsolete kerberos5_server_enable kdc_enable
20set_rcvar_obsolete kerberos5_server kdc_program
21set_rcvar_obsolete kerberos5_server_flags kdc_flags
22
23load_rc_config $name
24if [ "${kdc_program}" = /usr/libexec/kdc -o \
25     "${kdc_program}" = /usr/local/libexec/kdc ]; then
26	detach="--detach"
27	flavor=heimdal
28else
29	flavor=mit
30	unset detach
31fi
32
33case ${kdc_restart} in
34[Yy][Ee][Ss])
35	if [ "$flavor" = mit ]; then
36		detach=-n
37	else
38		unset detach
39	fi
40	case ${kdc_restart_delay} in
41	"")	unset daemon_restart_delay;;
42	*)	daemon_restart_delay="-R ${kdc_restart_delay}";;
43	esac
44	command_args="-r ${daemon_restart_delay} ${kdc_program} ${detach} ${command_args}"
45	kdc_program=/usr/sbin/daemon
46	;;
47*)
48	command_args="${detach} ${command_args}"
49	;;
50esac
51
52run_rc_command "$1"
53