From 5c24263779aef139ee5a3fa9d17790f4e0705681 Mon Sep 17 00:00:00 2001 From: Rich Lane Date: Thu, 18 Jul 2013 13:50:20 -0700 Subject: [PATCH] clean: send SIGTERM before SIGKILL IVS needs to be sent SIGTERM so it has a chance to clean up the kernel datapath. --- mininet/clean.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mininet/clean.py b/mininet/clean.py index 10f0cf8..5162bf3 100755 --- a/mininet/clean.py +++ b/mininet/clean.py @@ -11,6 +11,7 @@ nothing irreplaceable! """ from subprocess import Popen, PIPE +import time from mininet.log import info from mininet.term import cleanUpScreens @@ -31,6 +32,9 @@ def cleanup(): # Note: real zombie processes can't actually be killed, since they # are already (un)dead. Then again, # you can't connect to them either, so they're mostly harmless. + # Send SIGTERM first to give processes a chance to shutdown cleanly. + sh( 'killall ' + zombies + ' 2> /dev/null' ) + time.sleep(1) sh( 'killall -9 ' + zombies + ' 2> /dev/null' ) # And kill off sudo mnexec