Make parsing of daemon PIDs more robust
Summary:
In production on the cluster, we get output like this:
1 process1 22 process2 333 process3
That is, the PIDs are right-aligned. In this case, the explode(...) splits the line " 1 process1" on the first space, and we end up with an empty PID.
We later try to kill PID 0, which kills us.
Instead, trim.
Also, be slightly more liberal in splitting.
Test Plan: Ran phd stop --force in production, saw daemons get killed instead of the process itself.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D11786