HomePhabricator

Pass most daemon configuration over stdin

Description

Pass most daemon configuration over stdin

Summary:
Ref T7352. Currently, we pass daemon configuration entirely over command-line arguments. This produces command lines like these in the cluster:

php ./exec_daemon.php PhabricatorTaskmasterDaemon
  --load-phutil-library=/core/lib/arcanist/src
  --load-phutil-library=/core/lib/phabricator/src
  --load-phutil-library=/core/lib/core/src
  --load-phutil-library=/core/lib/services/src
  --log=/core//log/mail/phd/daemons.log --

This doesn't cause any problems, per se, but it's messy, makes "ps auxwww" hard to read, and makes it difficult to identify which processes are doing what. There's also some actual limit on command length, although I believe it is so huge on all modern systems that we'll never realistically hit it.

However, I plan to make daemon configuration more complex (introduce autoscaling arguments) and make overseer configuration much more complex (pass it a list of daemons). The overseer change essentially requires that it change to take arguments like this to remain reasonable. For consistency, and because it is nice to clean up "ps", pass them over stdin here too.

I also added a "-l nicelabel" flag which we can use to tag these processes with the instance they're running under to make "ps" more useful.

Test Plan: Ran phd start, phd debug nice, etc. Observed standard behavior.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7352

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

Details