Replace pidof call

Replace OS specific "pidof" call on more common and mostly equivalent
"ps" call. It allows to use framework not only on RedHat based OS.

Change-Id: I4ac1c145e30d7f2b43fcb371e819f9943eab91f1
This commit is contained in:
Dmitry Bogun 2016-12-12 13:51:20 +02:00 committed by Andrii Ostapenko
parent afc4b47fbc
commit cb1c3ff4f7
1 changed files with 3 additions and 1 deletions

View File

@ -123,4 +123,6 @@ def read_config(path):
def _pid_of(name):
return check_output(["pidof", name]).rstrip()
cmd = ['ps', '-o', 'pid=', '-C', name]
pidset = check_output(cmd).rstrip()
return [(int(x) for x in pidset.splitlines())]