mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-15 11:36:54 +02:00
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.
This commit is contained in:
parent
e9e20fdad8
commit
d2f2abe525
1 changed files with 6 additions and 1 deletions
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…
Add table
Reference in a new issue