1 # this kills yocto's server
2 from subprocess
import Popen
, PIPE
7 ret
= Popen(cmd
, stdout
=PIPE
, stderr
=PIPE
, shell
=True).communicate()
11 grep
= "grep -E 'python.*server.*yocto.*main.py|python.*yocto.*server.*main.py'"
12 proc_line
= exec_cmd('ps aux | ' + grep
).split('\n')[0]
13 srv_pid
= proc_line
.split()[1]
14 system('kill -9 ' + srv_pid
)