maybe detach from console?
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11296 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
13
kdc/main.c
13
kdc/main.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997-2002 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -32,12 +32,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kdc_locl.h"
|
#include "kdc_locl.h"
|
||||||
|
#ifdef HAVE_UTIL_H
|
||||||
|
#include <util.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
|
|
||||||
sig_atomic_t exit_flag = 0;
|
sig_atomic_t exit_flag = 0;
|
||||||
krb5_context context;
|
krb5_context context;
|
||||||
|
|
||||||
|
#ifdef HAVE_DAEMON
|
||||||
|
int no_detach = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
static RETSIGTYPE
|
static RETSIGTYPE
|
||||||
sigterm(int sig)
|
sigterm(int sig)
|
||||||
{
|
{
|
||||||
@@ -95,6 +102,10 @@ main(int argc, char **argv)
|
|||||||
#else
|
#else
|
||||||
signal(SIGINT, sigterm);
|
signal(SIGINT, sigterm);
|
||||||
signal(SIGTERM, sigterm);
|
signal(SIGTERM, sigterm);
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_DAEMON
|
||||||
|
if (!no_detach)
|
||||||
|
daemon(0, 0);
|
||||||
#endif
|
#endif
|
||||||
pidfile(NULL);
|
pidfile(NULL);
|
||||||
loop();
|
loop();
|
||||||
|
Reference in New Issue
Block a user