From a2553ef8adc7f3c9c66432f213a49673fd6840c3 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 26 Apr 2006 07:50:06 +0000 Subject: [PATCH] - setup PID file after daemon initilization, to correctly inform starter about daemon startup --- Source/charon/daemon.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/charon/daemon.c b/Source/charon/daemon.c index 680519228..4b0ea54e8 100644 --- a/Source/charon/daemon.c +++ b/Source/charon/daemon.c @@ -354,12 +354,14 @@ int main(int argc, char *argv[]) logger_manager->set_output(logger_manager, ALL_LOGGERS, NULL); } } - private_charon = daemon_create(); charon = (daemon_t*)private_charon; private_charon->logger = logger_manager->get_logger(logger_manager, DAEMON); + /* initialize daemon */ + private_charon->initialize(private_charon); + /* check/setup PID file */ if (stat(PID_FILE, &stb) == 0) { @@ -375,8 +377,7 @@ int main(int argc, char *argv[]) fclose(pid_file); } - /* initialize and run daemon */ - private_charon->initialize(private_charon); + /* run daemon */ private_charon->run(private_charon); /* normal termination, cleanup and exit */