Ack but I think you can remove "opensaf" from the remaining log string in 
daemon_exit.
Thanks,
Hans

On 01/27/2014 11:19 AM, [email protected] wrote:
>   osaf/libs/core/common/daemon.c      |  2 +-
>   osaf/services/saf/amf/amfd/ndfsm.cc |  5 ++---
>   2 files changed, 3 insertions(+), 4 deletions(-)
>
>
> amfd to exit immediately upon receiving local amfnd down [#728]
> Today amfd exits when the /etc/init.d/opensafd script invokes osaf-amfd 
> clc-cli
> script. This delayed exit can cause two problems 1) amfd exit can create a
> race with dtmd exit 2) The delayed exit can create problems during failover
> like say the amfd on the new active becomes functionally active and the old
> active still has a stale amfd.
> This patch makes AMFD exit immediately using daemon_exit()
> upon recieving amfnd down event.
>
> diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
> --- a/osaf/libs/core/common/daemon.c
> +++ b/osaf/libs/core/common/daemon.c
> @@ -369,7 +369,7 @@ static void sigterm_handler(int sig)
>    */
>   void daemon_exit(void)
>   {
> -     syslog(LOG_NOTICE, "exiting on signal %d", SIGTERM);
> +     syslog(LOG_NOTICE, "exiting for opensaf shutdown");
>
>       if (__gcov_flush) {
>               __gcov_flush();
> diff --git a/osaf/services/saf/amf/amfd/ndfsm.cc 
> b/osaf/services/saf/amf/amfd/ndfsm.cc
> --- a/osaf/services/saf/amf/amfd/ndfsm.cc
> +++ b/osaf/services/saf/amf/amfd/ndfsm.cc
> @@ -27,6 +27,7 @@
>
>   #include <amfd.h>
>   #include <cluster.h>
> +#include <daemon.h>
>
>   
> /*****************************************************************************
>    * Function: avd_node_up_func
> @@ -321,8 +322,7 @@ void avd_mds_avnd_down_evh(AVD_CL_CB *cb
>               // Do nothing if the local node goes down. Most likely due to 
> system shutdown.
>               // If node director goes down due to a bug, the AMF watchdog 
> will restart the node.
>               if (node->node_info.nodeId == cb->node_id_avd) {
> -                     TRACE("Ignoring down event for local node director");
> -                     goto done;
> +                     daemon_exit();
>               }
>
>               if (avd_cb->avail_state_avd == SA_AMF_HA_ACTIVE) {
> @@ -356,7 +356,6 @@ void avd_mds_avnd_down_evh(AVD_CL_CB *cb
>                       delete node_fovr;
>               }
>       }
> -done:
>       TRACE_LEAVE();
>   }
>
>
>

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to