diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-05-06 22:18:00 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-05-06 22:18:00 +0000 |
commit | ffccb594ca0935b26fa3b4ff4ae510f5f5f972e7 (patch) | |
tree | fc4291205b868798977f9005a82c04b183c1a215 /ace/Service_Config.cpp | |
parent | a4fb1df5a3696f5f5ec7ae98d848062774cedfce (diff) | |
download | ATCD-ffccb594ca0935b26fa3b4ff4ae510f5f5f972e7.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/Service_Config.cpp')
-rw-r--r-- | ace/Service_Config.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index 86e58214088..bbbd4e9cd12 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -587,6 +587,10 @@ ACE_Service_Config::open (const char program_name[]) { ACE_TRACE ("ACE_Service_Config::open"); + // Become a daemon before doing anything else. + if (ACE_Service_Config::be_a_daemon_) + ACE_Service_Config::start_daemon (); + // Only use STDERR if the users hasn't already set the flags. if (ACE_LOG_MSG->open (program_name, ACE_LOG_MSG->flags () ? ACE_LOG_MSG->flags () : (u_long) ACE_Log_Msg::STDERR, @@ -617,9 +621,6 @@ ACE_Service_Config::open (const char program_name[]) ACE_Service_Config::delete_reactor_ = 1; } - if (ACE_Service_Config::be_a_daemon_) - ACE_Service_Config::start_daemon (); - // Register ourselves to receive reconfiguration requests via // signals! @@ -960,6 +961,15 @@ ACE_Service_Config::reconfig_occurred (sig_atomic_t config_occurred) ACE_Service_Config::reconfig_occurred_ = config_occurred; } +// Become a daemon (i.e., run as a "background" process). + +int +ACE_Service_Config::start_daemon (void) +{ + ACE_TRACE ("ACE_Service_Config::start_daemon"); + return ACE::daemonize (); +} + #if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) template class ACE_Node<ACE_Static_Svc_Descriptor *>; template class ACE_Unbounded_Set<ACE_Static_Svc_Descriptor *>; |