Browse Source

Add force-exit timeout to get around some of the exit hang issues users have observed. Will punt full diagnosis to V2 which rewrites all these code paths anyway.

pull/2/head
Adam Ierymenko 5 years ago
parent
commit
d2f2abe525
No known key found for this signature in database
GPG Key ID: C8877CF2D7A5D7F3
  1. 7
      one.cpp

7
one.cpp

@ -1480,8 +1480,13 @@ static int idtool(int argc,char **argv)
static void _sighandlerHup(int sig)
{
}
static void _sighandlerReallyQuit(int sig)
{
exit(0);
}
static void _sighandlerQuit(int sig)
{
alarm(5); // force exit after 5s
OneService *s = zt1Service;
if (s)
s->terminate();
@ -1873,7 +1878,7 @@ int main(int argc,char **argv)
signal(SIGIO,SIG_IGN);
signal(SIGUSR1,SIG_IGN);
signal(SIGUSR2,SIG_IGN);
signal(SIGALRM,SIG_IGN);
signal(SIGALRM,&_sighandlerReallyQuit);
signal(SIGINT,&_sighandlerQuit);
signal(SIGTERM,&_sighandlerQuit);
signal(SIGQUIT,&_sighandlerQuit);

Loading…
Cancel
Save