# 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))):