add --detach
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14130 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2003 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2004 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -354,6 +354,9 @@ static char *realm;
|
|||||||
static int version_flag;
|
static int version_flag;
|
||||||
static int help_flag;
|
static int help_flag;
|
||||||
static char *keytab_str;
|
static char *keytab_str;
|
||||||
|
#ifdef HAVE_DAEMON
|
||||||
|
static int detach_from_console = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct getargs args[] = {
|
static struct getargs args[] = {
|
||||||
{ "config-file", 'c', arg_string, &config_file },
|
{ "config-file", 'c', arg_string, &config_file },
|
||||||
@@ -362,6 +365,10 @@ static struct getargs args[] = {
|
|||||||
"keytab to get authentication from", "kspec" },
|
"keytab to get authentication from", "kspec" },
|
||||||
{ "time-lost", 0, arg_string, &server_time_lost,
|
{ "time-lost", 0, arg_string, &server_time_lost,
|
||||||
"time before server is considered lost", "time" },
|
"time before server is considered lost", "time" },
|
||||||
|
#ifdef HAVE_DAEMON
|
||||||
|
{ "detach", 0, arg_flag, &detach_from_console,
|
||||||
|
"detach from console" },
|
||||||
|
#endif
|
||||||
{ "version", 0, arg_flag, &version_flag },
|
{ "version", 0, arg_flag, &version_flag },
|
||||||
{ "help", 0, arg_flag, &help_flag }
|
{ "help", 0, arg_flag, &help_flag }
|
||||||
};
|
};
|
||||||
@@ -421,6 +428,10 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
master = argv[0];
|
master = argv[0];
|
||||||
|
|
||||||
|
#ifdef HAVE_DAEMON
|
||||||
|
if (detach_from_console)
|
||||||
|
daemon(0, 0);
|
||||||
|
#endif
|
||||||
pidfile (NULL);
|
pidfile (NULL);
|
||||||
krb5_openlog (context, "ipropd-slave", &log_facility);
|
krb5_openlog (context, "ipropd-slave", &log_facility);
|
||||||
krb5_set_warn_dest(context, log_facility);
|
krb5_set_warn_dest(context, log_facility);
|
||||||
|
Reference in New Issue
Block a user