Skip to content

Commit

Permalink
change how we look for the PID
Browse files Browse the repository at this point in the history
Running the code with Python 3.8 on Ubuntu 20.04 it behaves differently
This match both cases
  • Loading branch information
thomas-mangin committed Jul 14, 2024
1 parent 06f95d7 commit 4e88dcf
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions qa/sbin/bgp
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,27 @@ def kill(signal_name='SIGUSR1'):
cmdline = line.strip().split()[4:]
pid = line.strip().split()[0]

if len(cmdline) > 1 and not cmdline[1].endswith('/main.py'):
if len(cmdline) < 1:
continue

if conf_name not in cmdline[-1]:
for word in cmdline:
if word.endswith('sbin/exabgp'):
break
if word.endswith('/main.py'):
break
else:
continue

if not cmdline[-1].endswith('.conf'):
for word in cmdline:
if conf_name in word:
break
else:
continue

for word in cmdline:
if word.endswith('.conf'):
break
else:
continue

processes.append(pid)
Expand Down

0 comments on commit 4e88dcf

Please sign in to comment.