fix for ssh stuck nodes

This commit is contained in:
Andrew Pamment 2018-02-07 18:01:17 +10:00
parent 686aee7226
commit 49fdd9695d
2 changed files with 1 additions and 3 deletions

View File

@ -775,7 +775,7 @@ void runbbs_real(int socket, char *ip, int ssh) {
st.sa_handler = sigterm_handler2;
sigemptyset(&st.sa_mask);
st.sa_flags = SA_SIGINFO;
if (sigaction(SIGTERM, &st, NULL) == -1) {
if (sigaction((ssh ? SIGHUP : SIGTERM), &st, NULL) == -1) {
dolog("Failed to setup sigterm handler.");
exit(1);
}

View File

@ -684,8 +684,6 @@ static void ssh_chan_close(ssh_session session, ssh_channel channel, void *userd
int status;
(void)session;
(void)channel;
kill(bbs_pid, SIGTERM);
waitpid(bbs_pid, &status, 0);
close(fd);
}