Formalize a "Query" class for looking at the process list

Authored by epriestley on Jun 20 2019, 8:58 PM.


Formalize a "Query" class for looking at the process list

Ref T13321. We currently use a mixture of PID files and examining the process list to figure out what daemons are running.

I'd like to move away from PID files, which aren't terribly reliable, particularly after hosts restart unexpectedly.

To prepare for this, write a "ProcessQuery", similar to Phabricator "Query" classes that can fetch a structured list of running processes.

This is very similar to existing code in PhutilDaemonOverseer::findRunningDaemons(), but I plan to remove that soon so I'm providing this as an alterantive rather than an upgrade.

Test Plan: See next chagnes.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13321

Differential Revision: https://secure.phabricator.com/D20600