Sergey Povarnin-Lelikov
unread,Mar 19, 2013, 10:58:49 AM3/19/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello all!
I have developed server application on C++ and start it as daemon. Application use GT.M Call-Ins wrapper (which used gtm_init(),...,gtm_exit()). Application starts Server (TCP) logic and Processor logic. Processor create Task (separate thread) which work with my GT.M Call-Ins wrapper, on start - gtm_init(), on stop - gtm_exit().
Start daemon: (application) --daemon
But I have stoped Application's Server and Processor only after SIGTERM or SIGQUIT signals, because Application wait for termination
I use C++ library POCO:
void Poco::ServerApplication::waitForTerminationRequest()
{
sigset_t sset;
sigemptyset(&sset);
if (!std::getenv("POCO_ENABLE_DEBUGGER"))
{
sigaddset(&sset, SIGINT);
}
sigaddset(&sset, SIGQUIT);
sigaddset(&sset, SIGTERM);
sigprocmask(SIG_BLOCK, &sset, NULL);
int sig;
sigwait(&sset, &sig);
}
Stop daemon: killall (application)
And from GT.M Programmer's Guide I have read:
"The external application should never use any signals when GT.M is active since GT.M reserves them for its internal use."
Question 1: How stop Processor (execute GT.M Call-Ins wrapper gtm_exit()) before daemon receive signal KILL? :(
Question 2: When daemon receive signal, it stop Server normally but when stopping Processor it failed with
"%GTM-F-KILLBYSIGSINFO1, GT.M process 22408 has been killed by a signal 11 at address 0x00007FE0E8085690 (vaddr 0x00007FE0E8085690)
%GTM-F-SIGACCERR, Signal was caused by invalid permissions for mapped object
Quit (core dumped)"
Is this paintfully for GT.M? :(
Very thanks for answers!
PS: Maybe you prompt me how send command to daemon and I can send stop before killall (application)?