]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Use SIGTERM for killing daemons first and only SIGBUS (7) if the daemons fail...
authorMartin Winter <mwinter@opensourcerouting.org>
Thu, 31 Aug 2017 00:06:35 +0000 (17:06 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
- This allows daemons to free up memory and avoid false memory leak reports

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/lib/topotest.py

index 2020e43874c450e98be0b82aa8b30a7ee7182265..4093c85e2d9ad5bbb915a5dc7cab6ba43ed7f204 100644 (file)
@@ -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))):