Don't test HAVE_DAEMON since roken supplies it.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15213 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -43,10 +43,8 @@ char *socket_path = NULL;
|
|||||||
|
|
||||||
static char *max_request_str; /* `max_request' as a string */
|
static char *max_request_str; /* `max_request' as a string */
|
||||||
|
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
int detach_from_console = -1;
|
int detach_from_console = -1;
|
||||||
#define DETACH_IS_DEFAULT FALSE
|
#define DETACH_IS_DEFAULT FALSE
|
||||||
#endif
|
|
||||||
|
|
||||||
static const char *system_cache_name = NULL;
|
static const char *system_cache_name = NULL;
|
||||||
static const char *system_keytab = NULL;
|
static const char *system_keytab = NULL;
|
||||||
@@ -81,7 +79,6 @@ static struct getargs args[] = {
|
|||||||
"max-request", 0, arg_string, &max_request,
|
"max-request", 0, arg_string, &max_request,
|
||||||
"max size for a kcm-request", "size"
|
"max size for a kcm-request", "size"
|
||||||
},
|
},
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
#if DETACH_IS_DEFAULT
|
#if DETACH_IS_DEFAULT
|
||||||
{
|
{
|
||||||
"detach", 'D', arg_negative_flag, &detach_from_console,
|
"detach", 'D', arg_negative_flag, &detach_from_console,
|
||||||
@@ -92,7 +89,6 @@ static struct getargs args[] = {
|
|||||||
"detach", 0 , arg_flag, &detach_from_console,
|
"detach", 0 , arg_flag, &detach_from_console,
|
||||||
"detach from console"
|
"detach from console"
|
||||||
},
|
},
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
{ "help", 'h', arg_flag, &help_flag },
|
{ "help", 'h', arg_flag, &help_flag },
|
||||||
{
|
{
|
||||||
@@ -364,13 +360,11 @@ kcm_configure(int argc, char **argv)
|
|||||||
krb5_err(kcm_context, 1, ret, "initializing system ccache");
|
krb5_err(kcm_context, 1, ret, "initializing system ccache");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
if(detach_from_console == -1)
|
if(detach_from_console == -1)
|
||||||
detach_from_console = krb5_config_get_bool_default(kcm_context, NULL,
|
detach_from_console = krb5_config_get_bool_default(kcm_context, NULL,
|
||||||
DETACH_IS_DEFAULT,
|
DETACH_IS_DEFAULT,
|
||||||
"kcm",
|
"kcm",
|
||||||
"detach", NULL);
|
"detach", NULL);
|
||||||
#endif
|
|
||||||
kcm_openlog();
|
kcm_openlog();
|
||||||
if(max_request == 0)
|
if(max_request == 0)
|
||||||
max_request = 64 * 1024;
|
max_request = 64 * 1024;
|
||||||
|
@@ -53,10 +53,8 @@ int num_db;
|
|||||||
|
|
||||||
const char *port_str;
|
const char *port_str;
|
||||||
|
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
int detach_from_console = -1;
|
int detach_from_console = -1;
|
||||||
#define DETACH_IS_DEFAULT FALSE
|
#define DETACH_IS_DEFAULT FALSE
|
||||||
#endif
|
|
||||||
|
|
||||||
int enable_http = -1;
|
int enable_http = -1;
|
||||||
krb5_boolean encode_as_rep_as_tgs_rep; /* bug compatibility */
|
krb5_boolean encode_as_rep_as_tgs_rep; /* bug compatibility */
|
||||||
@@ -124,7 +122,6 @@ static struct getargs args[] = {
|
|||||||
{ "ports", 'P', arg_string, &port_str,
|
{ "ports", 'P', arg_string, &port_str,
|
||||||
"ports to listen to", "portspec"
|
"ports to listen to", "portspec"
|
||||||
},
|
},
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
#if DETACH_IS_DEFAULT
|
#if DETACH_IS_DEFAULT
|
||||||
{
|
{
|
||||||
"detach", 'D', arg_negative_flag, &detach_from_console,
|
"detach", 'D', arg_negative_flag, &detach_from_console,
|
||||||
@@ -135,7 +132,6 @@ static struct getargs args[] = {
|
|||||||
"detach", 0 , arg_flag, &detach_from_console,
|
"detach", 0 , arg_flag, &detach_from_console,
|
||||||
"detach from console"
|
"detach from console"
|
||||||
},
|
},
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
{ "addresses", 0, arg_strings, &addresses_str,
|
{ "addresses", 0, arg_strings, &addresses_str,
|
||||||
"addresses to listen on", "list of addresses" },
|
"addresses to listen on", "list of addresses" },
|
||||||
@@ -417,13 +413,11 @@ configure(int argc, char **argv)
|
|||||||
"kdc_warn_pwexpire",
|
"kdc_warn_pwexpire",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
if(detach_from_console == -1)
|
if(detach_from_console == -1)
|
||||||
detach_from_console = krb5_config_get_bool_default(context, NULL,
|
detach_from_console = krb5_config_get_bool_default(context, NULL,
|
||||||
DETACH_IS_DEFAULT,
|
DETACH_IS_DEFAULT,
|
||||||
"kdc",
|
"kdc",
|
||||||
"detach", NULL);
|
"detach", NULL);
|
||||||
#endif
|
|
||||||
kdc_openlog();
|
kdc_openlog();
|
||||||
if(max_request == 0)
|
if(max_request == 0)
|
||||||
max_request = 64 * 1024;
|
max_request = 64 * 1024;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997-2002 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997-2002, 2004-2005 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -41,9 +41,7 @@ RCSID("$Id$");
|
|||||||
sig_atomic_t exit_flag = 0;
|
sig_atomic_t exit_flag = 0;
|
||||||
krb5_context context;
|
krb5_context context;
|
||||||
|
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
extern int detach_from_console;
|
extern int detach_from_console;
|
||||||
#endif
|
|
||||||
|
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
sigterm(int sig)
|
sigterm(int sig)
|
||||||
@@ -107,10 +105,8 @@ main(int argc, char **argv)
|
|||||||
signal(SIGTERM, sigterm);
|
signal(SIGTERM, sigterm);
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
if (detach_from_console)
|
if (detach_from_console)
|
||||||
daemon(0, 0);
|
daemon(0, 0);
|
||||||
#endif
|
|
||||||
pidfile(NULL);
|
pidfile(NULL);
|
||||||
loop();
|
loop();
|
||||||
krb5_free_context(context);
|
krb5_free_context(context);
|
||||||
|
@@ -605,9 +605,7 @@ static char *keytab_str = "HDB:";
|
|||||||
static char *database;
|
static char *database;
|
||||||
static char *config_file;
|
static char *config_file;
|
||||||
static char *port_str;
|
static char *port_str;
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
static int detach_from_console = 0;
|
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 },
|
||||||
@@ -622,11 +620,9 @@ static struct getargs args[] = {
|
|||||||
{ "time-gone", 0, arg_string, &slave_time_gone,
|
{ "time-gone", 0, arg_string, &slave_time_gone,
|
||||||
"time of inactivity after which a slave is considered gone", "time"},
|
"time of inactivity after which a slave is considered gone", "time"},
|
||||||
{ "port", 0, arg_string, &port_str,
|
{ "port", 0, arg_string, &port_str,
|
||||||
"port ipropd will listen too", "port"},
|
"port ipropd will listen to", "port"},
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
{ "detach", 0, arg_flag, &detach_from_console,
|
{ "detach", 0, arg_flag, &detach_from_console,
|
||||||
"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 }
|
||||||
};
|
};
|
||||||
@@ -676,10 +672,8 @@ main(int argc, char **argv)
|
|||||||
if (time_before_missing < 0)
|
if (time_before_missing < 0)
|
||||||
krb5_errx (context, 1, "couldn't parse time: %s", slave_time_missing);
|
krb5_errx (context, 1, "couldn't parse time: %s", slave_time_missing);
|
||||||
|
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
if (detach_from_console)
|
if (detach_from_console)
|
||||||
daemon(0, 0);
|
daemon(0, 0);
|
||||||
#endif
|
|
||||||
pidfile (NULL);
|
pidfile (NULL);
|
||||||
krb5_openlog (context, "ipropd-master", &log_facility);
|
krb5_openlog (context, "ipropd-master", &log_facility);
|
||||||
krb5_set_warn_dest(context, log_facility);
|
krb5_set_warn_dest(context, log_facility);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2004 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2005 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -365,9 +365,7 @@ static int version_flag;
|
|||||||
static int help_flag;
|
static int help_flag;
|
||||||
static char *keytab_str;
|
static char *keytab_str;
|
||||||
static char *port_str;
|
static char *port_str;
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
static int detach_from_console = 0;
|
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 },
|
||||||
@@ -378,10 +376,8 @@ static struct getargs args[] = {
|
|||||||
"time before server is considered lost", "time" },
|
"time before server is considered lost", "time" },
|
||||||
{ "port", 0, arg_string, &port_str,
|
{ "port", 0, arg_string, &port_str,
|
||||||
"port ipropd-slave will connect to", "port"},
|
"port ipropd-slave will connect to", "port"},
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
{ "detach", 0, arg_flag, &detach_from_console,
|
{ "detach", 0, arg_flag, &detach_from_console,
|
||||||
"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 }
|
||||||
};
|
};
|
||||||
@@ -441,10 +437,8 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
master = argv[0];
|
master = argv[0];
|
||||||
|
|
||||||
#ifdef HAVE_DAEMON
|
|
||||||
if (detach_from_console)
|
if (detach_from_console)
|
||||||
daemon(0, 0);
|
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