From d8d14738e25c6fcb8a0ffee1ca9a7c5c6f3a738d Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Wed, 28 Aug 2002 21:26:43 +0000 Subject: [PATCH] add detach options git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11297 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kdc/config.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/kdc/config.c b/kdc/config.c index e41b05675..9250504ba 100644 --- a/kdc/config.c +++ b/kdc/config.c @@ -53,6 +53,11 @@ int num_db; const char *port_str; +#ifdef HAVE_DAEMON +int detach_from_console = -1; +#define DETACH_IS_DEFAULT FALSE +#endif + int enable_http = -1; krb5_boolean encode_as_rep_as_tgs_rep; /* bug compatibility */ @@ -112,6 +117,19 @@ static struct getargs args[] = { { "ports", 'P', arg_string, &port_str, "ports to listen to", "portspec" }, +#ifdef HAVE_DAEMON +#if DETACH_IS_DEFAULT + { + "detach", 'D', arg_negative_flag, &detach_from_console, + "don't detach from console" + }, +#else + { + "detach", 0 , arg_flag, &detach_from_console, + "detach from console" + }, +#endif +#endif { "addresses", 0, arg_strings, &addresses_str, "addresses to listen on", "list of addresses" }, { "help", 'h', arg_flag, &help_flag }, @@ -358,6 +376,12 @@ configure(int argc, char **argv) "kdc", "kdc_warn_pwexpire", NULL); + + if(detach_from_console == -1) + detach_from_console = krb5_config_get_bool_default(context, NULL, + DETACH_IS_DEFAULT, + "kdc", + "detach", NULL); kdc_openlog(); if(max_request == 0) max_request = 64 * 1024;