rc.d: Add MIT KRB5 krb5kdc support

MIT KRB5 krb5kdc differs from the Heimdal kdc.

- The MIT kdc is named krb5kdc while the Heimdal one is named kdc.
- krb5kdc -d flag has a different meaning. krb5kdc -d specifies a
  database name. While the Heimdal kdc uses the -d flag to daemonize
  it. krb5kdc automaticially daemonizes itself unless the -n flag is
  specified.

We do this by looking at the name of the kdc program to determine if
we assume it's a Heimdal kdc or the MIT krb5kdc.

Sponsored by:		The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D50813
This commit is contained in:
Cy Schubert
2025-06-10 19:48:06 -07:00
parent 1b735665f4
commit 4103f8dd57
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -326,7 +326,7 @@ resolv_enable="YES" # Enable resolv / resolvconf
# kerberos. Do not run the admin daemons on slave servers
#
kdc_enable="NO" # Run a kerberos 5 KDC (or NO).
kdc_program="/usr/libexec/kdc" # path to kerberos 5 KDC
kdc_program="" # path to kerberos 5 KDC
kdc_flags="" # Additional flags to the kerberos 5 KDC
kdc_restart="NO" # Auto restart kdc on abnormal termination
kdc_restart_delay="" # Auto restart delay seconds
+15
View File
@@ -20,7 +20,22 @@ set_rcvar_obsolete kerberos5_server_enable kdc_enable
set_rcvar_obsolete kerberos5_server kdc_program
set_rcvar_obsolete kerberos5_server_flags kdc_flags
default_kdc_programs='/usr/libexec/kdc /usr/libexec/kdc /usr/libexec/krb5kdc /usr/local/sbin/krb5kdc'
load_rc_config $name
# XXX Remove the following block of code when Heimdal is removed
if [ -z "${kdc_program}" ]; then
for i in ${default_kdc_programs}; do
if [ -x "${i}" ]; then
kdc_program=${i}
break
fi
done
fi
command="${kdc_program}"
if [ "${kdc_program}" = /usr/libexec/kdc -o \
"${kdc_program}" = /usr/local/libexec/kdc ]; then
detach="--detach"