From ef3f12c742638191b8f6e2de346c43b30973b748 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Tue, 21 Sep 2004 14:56:03 +0000 Subject: [PATCH] add --detach git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14247 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/kadm5/ipropd_master.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/kadm5/ipropd_master.c b/lib/kadm5/ipropd_master.c index e15a99ee4..55974e9b3 100644 --- a/lib/kadm5/ipropd_master.c +++ b/lib/kadm5/ipropd_master.c @@ -591,6 +591,9 @@ static int help_flag; static char *keytab_str = "HDB:"; static char *database; static char *config_file; +#ifdef HAVE_DAEMON +static int detach_from_console = 0; +#endif static struct getargs args[] = { { "config-file", 'c', arg_string, &config_file }, @@ -601,6 +604,10 @@ static struct getargs args[] = { { "slave-stats-file", 0, arg_string, &slave_stats_file, "file"}, { "time-missing", 0, arg_string, &slave_time_missing, "time"}, { "time-gone", 0, arg_string, &slave_time_gone, "time"}, +#ifdef HAVE_DAEMON + { "detach", 0, arg_flag, &detach_from_console, + "detach from console" }, +#endif { "version", 0, arg_flag, &version_flag }, { "help", 0, arg_flag, &help_flag } }; @@ -650,6 +657,10 @@ main(int argc, char **argv) if (time_before_missing < 0) krb5_errx (context, 1, "couldn't parse time: %s", slave_time_missing); +#ifdef HAVE_DAEMON + if (detach_from_console) + daemon(0, 0); +#endif pidfile (NULL); krb5_openlog (context, "ipropd-master", &log_facility); krb5_set_warn_dest(context, log_facility);