From: Martin Winter Date: Thu, 31 Aug 2017 00:06:35 +0000 (-0700) Subject: lib: Use SIGTERM for killing daemons first and only SIGBUS (7) if the daemons fail... X-Git-Tag: frr-7.1-dev~151^2~218 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7551168cba20eabcc6bad6afd35cf19ca0d541c6;p=mirror%2Ffrr.git lib: Use SIGTERM for killing daemons first and only SIGBUS (7) if the daemons fail to exit. - This allows daemons to free up memory and avoid false memory leak reports Signed-off-by: Martin Winter --- diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 2020e43874..4093c85e2d 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -522,6 +522,13 @@ class Router(Node): # Stop Running Quagga or FRR Daemons rundaemons = self.cmd('ls -1 /var/run/%s/*.pid' % self.routertype) if rundaemons is not None: + for d in StringIO.StringIO(rundaemons): + daemonpid = self.cmd('cat %s' % d.rstrip()).rstrip() + if (daemonpid.isdigit() and pid_exists(int(daemonpid))): + self.cmd('kill -TERM %s' % daemonpid) + self.waitOutput() + sleep(2) + # 2nd round of kill if daemons didn't exist for d in StringIO.StringIO(rundaemons): daemonpid = self.cmd('cat %s' % d.rstrip()).rstrip() if (daemonpid.isdigit() and pid_exists(int(daemonpid))):