mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
When not debugging, daemonize automatically.
This commit is contained in:
parent
33a368ad59
commit
0bcba21e89
@ -337,7 +337,12 @@ signal_init(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static char *opt_list = "c:dD:s:";
|
static char *opt_list = "c:dD:s:";
|
||||||
static int debug_flag = 1; /* FIXME: Turn off for production use */
|
|
||||||
|
#ifdef DEBUGGING
|
||||||
|
static int debug_flag = 1;
|
||||||
|
#else
|
||||||
|
static int debug_flag = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
@ -406,6 +411,16 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
read_config();
|
read_config();
|
||||||
|
|
||||||
|
if (!debug_flag)
|
||||||
|
{
|
||||||
|
pid_t pid = fork();
|
||||||
|
if (pid < 0)
|
||||||
|
die("fork: %m");
|
||||||
|
if (!pid)
|
||||||
|
return 0;
|
||||||
|
setsid();
|
||||||
|
}
|
||||||
|
|
||||||
signal_init();
|
signal_init();
|
||||||
|
|
||||||
cli_init_unix();
|
cli_init_unix();
|
||||||
|
Loading…
Reference in New Issue
Block a user