Skip to content

Conversation

@PraveenPenguin
Copy link
Collaborator

No description provided.

… name

Added a library function which retruns linux process based on process name

Signed-off-by: Praveen K Pandey <[email protected]>
@PraveenPenguin PraveenPenguin force-pushed the add_kill branch 2 times, most recently from 89c1462 to 23559ab Compare May 14, 2024 13:58
added a library function which help to kill linuxprocess

Signed-off-by: Praveen K Pandey <[email protected]>
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @PraveenPenguin, thank you for your contribution. I have a question about psutil please have a look.

"""

import os
import psutil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clebergnu it is a reverse way , I am looking process id having input as process name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@richtja richtja requested a review from clebergnu May 20, 2024 13:08
Copy link
Contributor

@clebergnu clebergnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @PraveenPenguin it looks like this data can be obtained without the psutil library. Please refer to my other comment.

@PraveenPenguin
Copy link
Collaborator Author

@clebergnu any thoughts on this ?

@clebergnu
Copy link
Contributor

@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 avocado.utils.*. Especially psutil which needs to be compiled (or have a pre-compiled build).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review Requested

Development

Successfully merging this pull request may close these issues.

3 participants