Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
pcp.env: _get_pids_by_name returns all pmcd pids on machine with containers #101
Comments
|
Can you explain why you're running pmcd servers inside multiple containers? One running on the host should be able to give intra-container data for those other systems (before too long, if not already). |
|
Because I want to monitor metrics from pcp with a nagios script. These are not docker containers but kind of "normal machines" (one can ssh to them, install stuff and such). I already have automation to set up services and monitoring per host. Apart from that, why the function _get_pids_by_name gets all pids of a specific program and not only those that a parent is pid 1? Is it used not only in init scripts? |
Its used almost exclusively from the init scripts; there's a corner case in that its used from a number of the test scripts. However, that's something that could be resolved (e.g. via separate shell function), and its arguably desirable to restrict the set of processes the init scripts lookup in this way too, as often they are being considered as targets for kill(1) - IOW, maybe this change would be beneficial anyway. @kmcdonell are there any other situations you know of where _get_pids_by_name() might not be looking for init-parented processes? |
|
gentle ping |
test-account-0 commentedAug 2, 2016
I'm using pmcd on machines with containers which also have pmcd. Theese container are based on openvz and lxc.
With the current version of /etc/pcp.env I cannot start, stop, restart et cetera pmcd (and probably other pcp services).
As a workaround I have changed function _get_pids_by_name from:
to:
It echoes only those pids that a parent is pid 1.
I'm not sure if it is good/compatilble enough to make a pull request.
It is working on wheezy, jessie, precise, trusty and xenial.