On a related topic, I had this patch written(untested) sometime back for the rest of the services Some things to consider - add graceful (pthread cancel and join) exit for log service(now that there is a separate thread introduced) - see if imm's sub processes needs-to/can be gracefully shutdown
Otherwise, I think this patch sent for review is ok or will atleast not introduce any new problem because exit is done from the main thread! I shall test my attached patch(after doing necessary changes for LOG) and send for review. Cheers, Mathi. > -----Original Message----- > From: Hans Feldt [mailto:osafde...@gmail.com] > Sent: Thursday, October 03, 2013 6:25 PM > To: anders.wid...@ericsson.com; Mathivanan Naickan Palanivelu > Cc: opensaf-devel@lists.sourceforge.net > Subject: [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581] > > osaf/libs/core/common/daemon.c | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > > > By calling exit() instead of _Exit() registered exit functions are called. > This > enabled for example flushing of gcov data. > > 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 > @@ -355,13 +355,16 @@ static void sigterm_handler(int sig) } > > /** > - * Exit process with a standard syslog message > - * To be called after the service has cleaned up per service specific things > + * Exit calling process with exit(0) using a standard syslog message. > + * This function should be called from the main thread of a server > + process in > + * a "safe" context for calling exit(). Any service specific thing > + should be > + * cleaned up before calling this function. By calling exit(), > + registered exit > + * functions are called before the process is terminated. > */ > void daemon_exit(void) > { > syslog(LOG_NOTICE, "exiting on signal %d", SIGTERM); > - _Exit(EXIT_SUCCESS); > + exit(0); > } > > /**
2615_imm.patch
Description: Binary data
2615_stop.patch
Description: Binary data
------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel