[CRIU] [PATCH] pycriu: Dont produce zombies

Pavel Emelyanov xemul at virtuozzo.com
Thu Apr 13 08:27:13 PDT 2017


When running criu_dump() with zero pid (self dump) a zombie
from the library is left underneath the running processes
and this zombie is thus written into the images.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 lib/py/criu.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/py/criu.py b/lib/py/criu.py
index 8725758..c4a09ea 100644
--- a/lib/py/criu.py
+++ b/lib/py/criu.py
@@ -113,6 +113,9 @@ class _criu_comm_bin(_criu_comm):
 					os._exit(0)
 			else:
 				exec_criu()
+		else:
+			if daemon:
+				os.waitpid(p, 0)
 
 		css[0].close()
 		self.swrk = struct.unpack('i', css[1].recv(4))[0]
-- 
2.5.5


More information about the CRIU mailing list