dom0/qrexec: kill child process on connect timeout
Sometimes vchan can not detect dead target domain so kill it explicit to not leave a mess.
This commit is contained in:
parent
96199058d1
commit
d1620d9a32
@ -95,13 +95,14 @@ void init(int xid)
|
|||||||
char qrexec_error_log_name[256];
|
char qrexec_error_log_name[256];
|
||||||
int logfd;
|
int logfd;
|
||||||
int i;
|
int i;
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
if (xid <= 0) {
|
if (xid <= 0) {
|
||||||
fprintf(stderr, "domain id=0?\n");
|
fprintf(stderr, "domain id=0?\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
signal(SIGUSR1, sigusr1_handler);
|
signal(SIGUSR1, sigusr1_handler);
|
||||||
switch (fork()) {
|
switch (pid=fork()) {
|
||||||
case -1:
|
case -1:
|
||||||
perror("fork");
|
perror("fork");
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -114,6 +115,7 @@ void init(int xid)
|
|||||||
fprintf(stderr, ".");
|
fprintf(stderr, ".");
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Cannot connect to qrexec agent for %d seconds, giving up\n", MAX_STARTUP_TIME);
|
fprintf(stderr, "Cannot connect to qrexec agent for %d seconds, giving up\n", MAX_STARTUP_TIME);
|
||||||
|
kill(pid, SIGTERM);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
close(0);
|
close(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user