Added a library function which help to get linux process and kill those process#5932
Added a library function which help to get linux process and kill those process#5932PraveenPenguin wants to merge 2 commits intoavocado-framework:masterfrom
Conversation
… name Added a library function which retruns linux process based on process name Signed-off-by: Praveen K Pandey <praveen@linux.vnet.ibm.com>
89c1462 to
23559ab
Compare
added a library function which help to kill linuxprocess Signed-off-by: Praveen K Pandey <praveen@linux.vnet.ibm.com>
richtja
left a comment
There was a problem hiding this comment.
Hi @PraveenPenguin, thank you for your contribution. I have a question about psutil please have a look.
| """ | ||
|
|
||
| import os | ||
| import psutil |
There was a problem hiding this comment.
I can see that you are adding psutil as requirement for this utility which is new requirement for Avocado. Unfortunately, right now we don't have a way how to add utils specific requirements. Is it possible for you to do this without psutil ?
PS: Right now we are working on autils project which should merge avocado and avocado-vt utils together and there we should be able to add utils specific requirement. Unfortunately, this project is not prepared yet.
There was a problem hiding this comment.
@richtja I tried, but we need to grep or awk in ps command that seems not good way, please suggest if you have anything in mind
There was a problem hiding this comment.
@PraveenPenguin it looks like you're after the process name. That should be available under /proc/$PID/comm. Let me know if there's other info you're after.
There was a problem hiding this comment.
@clebergnu it is a reverse way , I am looking process id having input as process name
There was a problem hiding this comment.
I understand that, but you can still look through the process entries and compare with the name. It's not a good idea to add such a complex external dependency as mandatory to avocado.utils.*. Especially psutil which needs to be compiled (or have a pre-compiled build).
clebergnu
left a comment
There was a problem hiding this comment.
Hi @PraveenPenguin it looks like this data can be obtained without the psutil library. Please refer to my other comment.
|
@clebergnu any thoughts on this ? |
I understand that, but you can still look through the process entries and compare with the name. It's not a good idea to add such a complex external dependency as mandatory to |
No description provided.