Skip to content

Improve "ps" command for OpenVZ hardware nodes #759

Closed
hathawsh opened this Issue Feb 25, 2012 · 6 comments

2 participants

@hathawsh

When Salt is managing an OpenVZ hardware node, the command "ps -efH" returns information about all processes in all containers. This is very likely not what the sysadmin intends and it makes the service.status command return false positives.

When grains['virtual'] == 'openvzhn', a better setting for grains['ps'] would be 'vzps -E 0 -efH|cut -b 6-', which filters out guest processes and formats the output similarly to the standard 'ps' command.

@thatch45
Salt Stack member

Thanks for the heads up! This should be an easy fix!

@thatch45
Salt Stack member

1211cff

Does this look all right?

@hathawsh

Are you certain that the _ps function will be called after the _virtual function? If _virtual is called first then this patch should work, but if _ps happens to be called first then the ps command will revert to the non-VZ form.

@thatch45
Salt Stack member

Yes, it is. The functions which have underscores are only called internally, not by the loader

@hathawsh

Sounds good then, thanks!

@thatch45
Salt Stack member

Thank you!

@thatch45 thatch45 closed this Feb 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.