From cbfc88f691b4baa3c86bfd158afedd6b7a09f80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 25 Jan 2009 00:39:45 +0000 Subject: [PATCH] wrap detach git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24411 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/kadm5/ipropd_master.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/kadm5/ipropd_master.c b/lib/kadm5/ipropd_master.c index 94e2bed70..5b85c07e0 100644 --- a/lib/kadm5/ipropd_master.c +++ b/lib/kadm5/ipropd_master.c @@ -34,8 +34,6 @@ #include "iprop.h" #include -RCSID("$Id$"); - static krb5_log_facility *log_facility; const char *slave_stats_file; @@ -708,7 +706,9 @@ static char *keytab_str = "HDB:"; static char *database; static char *config_file; static char *port_str; +#ifdef SUPPORT_DETACH static int detach_from_console = 0; +#endif static struct getargs args[] = { { "config-file", 'c', arg_string, &config_file }, @@ -724,8 +724,10 @@ static struct getargs args[] = { "time of inactivity after which a slave is considered gone", "time"}, { "port", 0, arg_string, &port_str, "port ipropd will listen to", "port"}, +#ifdef SUPPORT_DETACH { "detach", 0, arg_flag, &detach_from_console, "detach from console" }, +#endif { "hostname", 0, arg_string, &master_hostname, "hostname of master (if not same as hostname)", "hostname" }, { "version", 0, arg_flag, &version_flag }, @@ -782,8 +784,10 @@ main(int argc, char **argv) if (time_before_missing < 0) krb5_errx (context, 1, "couldn't parse time: %s", slave_time_missing); +#ifdef SUPPORT_DETACH if (detach_from_console) daemon(0, 0); +#endif pidfile (NULL); krb5_openlog (context, "ipropd-master", &log_facility); krb5_set_warn_dest(context, log_facility);