]> granicus.if.org Git - pdns/commitdiff
Clean up after DynListener crash
authorIgor Maravic <igor@spotify.com>
Tue, 24 Sep 2013 11:47:39 +0000 (13:47 +0200)
committerIgor Maravic <igor@spotify.com>
Tue, 8 Oct 2013 08:00:48 +0000 (10:00 +0200)
When DynListener crashes, kill all processes from his parent PGRP.

This way we'll certanly close the pdns.controlsocket (no more hanging pdns_control processes)
and we'll kill the processes that aren't managable via pdns_control any more.

pdns/dynlistener.cc

index 0e80ab15bde04f0baba1ebee699b2d237d9653c5..daec1d9dd352a07f630fe9c879277db47a34ad5f 100644 (file)
@@ -199,6 +199,8 @@ void *DynListener::theListenerHelper(void *p)
   DynListener *us=static_cast<DynListener *>(p);
   us->theListener();
   L<<Logger::Error<<"Control listener aborted, please file a bug!"<<endl;
+  L<<Logger::Error<<"Taking down the Parent PGRP ("<<getpgid(us->d_ppid)<<") with it"<<endl;
+  kill(-getpgid(us->d_ppid),SIGKILL);
   return 0;
 }