git: 83ab4d6cc58b - stable/14 - rc.d/kdc: Support start of MIT krb5kdc

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Mon, 29 Jan 2024 00:29:50 UTC
The branch stable/14 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=83ab4d6cc58bd53b84a819d51b032ba17f3f6a8c

commit 83ab4d6cc58bd53b84a819d51b032ba17f3f6a8c
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2024-01-20 13:52:35 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-01-29 00:26:05 +0000

    rc.d/kdc: Support start of MIT krb5kdc
    
    Some users wishing to use the MIT krb5kdc have discovered the
    kdc script workaround applied to the MIT krb5 ports is insufficient.
    Let's build into this rc script the smarts to determine whether
    base or ports Hiemdal kdc is being invoked or the MIT krb5kdc.
    
    While at it, remove kdc_start_precmd(). This will simplify a future
    jail patch.
    
    Suggested by:           netchild
    Original patch:         netchild
    Reviewed by:            emaste, netchild
    Differential Revision:  https://reviews.freebsd.org/D43523
    
    (cherry picked from commit 91f78c32befa08bf4010db7afd4407277a3e585f)
---
 libexec/rc/rc.d/kdc | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libexec/rc/rc.d/kdc b/libexec/rc/rc.d/kdc
index 4b8cf87197e8..c3059f261e09 100755
--- a/libexec/rc/rc.d/kdc
+++ b/libexec/rc/rc.d/kdc
@@ -12,17 +12,15 @@
 name=kdc
 desc="Kerberos 5 server"
 rcvar=${name}_enable
-start_precmd=${name}_start_precmd
 
 set_rcvar_obsolete kerberos5_server_enable kdc_enable
 set_rcvar_obsolete kerberos5_server kdc_program
 set_rcvar_obsolete kerberos5_server_flags kdc_flags
 
-kdc_start_precmd()
-{
-
-	command_args="$command_args --detach"
-}
 
 load_rc_config $name
+if [ "${kdc_program}" = /usr/libexec/kdc -o \
+     "${kdc_program}" = /usr/local/libexec/kdc ]; then
+	command_args="$command_args --detach"
+fi
 run_rc_command "$1"