From 230a30274e6fcb4b8642c005a68f2d01d3bb0db7 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 7 Feb 2007 15:00:06 +0000 Subject: [PATCH] added child exit handling code and example git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@821 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Application/Settings.pm | 4 ++++ src/perlmods/OpenSRF/UnixServer.pm | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/perlmods/OpenSRF/Application/Settings.pm b/src/perlmods/OpenSRF/Application/Settings.pm index 8c2e8d6..561b1d8 100644 --- a/src/perlmods/OpenSRF/Application/Settings.pm +++ b/src/perlmods/OpenSRF/Application/Settings.pm @@ -1,8 +1,12 @@ package OpenSRF::Application::Settings; use OpenSRF::Application; use OpenSRF::Utils::SettingsParser; +use OpenSRF::Utils::Logger qw/$logger/; use base 'OpenSRF::Application'; +sub child_exit { + $logger->debug("settings server child exiting...$$"); +} __PACKAGE__->register_method( method => 'get_host_config', api_name => 'opensrf.settings.host_config.get' ); diff --git a/src/perlmods/OpenSRF/UnixServer.pm b/src/perlmods/OpenSRF/UnixServer.pm index b80a9b5..30fed99 100644 --- a/src/perlmods/OpenSRF/UnixServer.pm +++ b/src/perlmods/OpenSRF/UnixServer.pm @@ -2,7 +2,7 @@ package OpenSRF::UnixServer; use strict; use warnings; use base qw/OpenSRF/; use OpenSRF::EX qw(:try); -use OpenSRF::Utils::Logger qw(:level); +use OpenSRF::Utils::Logger qw(:level $logger); use OpenSRF::Transport::PeerHandle; use OpenSRF::Application; use OpenSRF::AppSession; @@ -18,12 +18,8 @@ use Carp; use IO::Socket::INET; use IO::Socket::UNIX; -# XXX Need to add actual logging statements in the code -my $logger = "OpenSRF::Utils::Logger"; - sub DESTROY { confess "Dying $$"; } - =head1 What am I All inbound messages are passed on to the UnixServer for processing. @@ -259,5 +255,12 @@ sub child_init_hook { return OpenSRF::Transport::PeerHandle->retrieve; } +sub child_finish_hook { + $logger->debug("attempting to call child exit handler..."); + OpenSRF::Application->application_implementation->child_exit + if (OpenSRF::Application->application_implementation->can('child_exit')); +} + + 1; -- 2.11.0