Do it in frontend_net event loop rather than in place for metaproxy
main, which only exits when all sessions are terminated for SIGUSR1
at graceful stop.
while (m_p->mySocketManager.processEvent() > 0)
{
if (m_p->m_stop_signo == SIGTERM)
+ {
+ yaz_log(YLOG_LOG, "metaproxy received SIGTERM");
break; /* stop right away */
+ }
if (m_p->m_stop_signo == SIGUSR1)
{ /* just stop listeners and cont till all sessions are done*/
+ yaz_log(YLOG_LOG, "metaproxy received SIGUSR1");
m_p->m_stop_signo = 0;
if (m_p->az)
{
mp::Package pack;
pack.router(*routerp).move();
-#if HAVE_UNISTD_H
- switch (sig_received)
- {
- case SIGTERM:
- yaz_log(YLOG_LOG, "metaproxy received SIGTERM");
- break;
- case SIGUSR1:
- yaz_log(YLOG_LOG, "metaproxy received SIGUSR1");
- break;
- case 0:
- break;
- default:
- yaz_log(YLOG_LOG, "metaproxy received signo=%d", sig_received);
- }
-#endif
yaz_log(YLOG_LOG, "metaproxy stop");
delete routerp;
routerp = 0;