Skip to content

Commit 5d8e599

Browse files
committed
net/pasta: kill pasta when the container/jail dies
1 parent 037d8a3 commit 5d8e599

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

subproc.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ static void removeProc(nsjconf_t* nsjconf, pid_t pid) {
259259
}
260260

261261
const auto& p = nsjconf->pids[pid];
262+
if (p.pasta_pid > 0) {
263+
LOG_D("Killing pasta pid=%d", p.pasta_pid);
264+
kill(p.pasta_pid, SIGKILL);
265+
while (waitpid(p.pasta_pid, nullptr, 0) == -1 && errno == EINTR);
266+
}
262267
LOG_D("Removed pid=%d from the queue (IP:'%s', start time:'%s')", pid, p.remote_txt.c_str(),
263268
util::timeToStr(p.start).c_str());
264269

0 commit comments

Comments
 (0)