HomePhabricator

Check daemon piddir writability before forking in daemons

Description

Check daemon piddir writability before forking in daemons

Summary: See rP2fedb6f941d8. We do tell the user about this, but it ends up in the daemon logfile, which is very obscure since essentially every other type of failure has a better communication channel nowadays.

Test Plan:

$ PHACILITY_INSTANCE=local ./bin/phd start
Freeing active task leases...
Freed 0 task lease(s).
Preparing to launch daemons.
NOTE: Logs will appear in '/Users/epriestley/dev/core//log/local/phd/daemons.log'.

Starting daemons as epriestley
Launching daemon "PhabricatorRepositoryPullLocalDaemon".
sudo command failed. Starting daemon as current user
[2014-12-23 14:05:26] EXCEPTION: (CommandException) Command failed with error #255!
COMMAND
exec ./phd-daemon 'PhabricatorRepositoryPullLocalDaemon' --daemonize --log='/Users/epriestley/dev/core//log/local/phd/daemons.log' --phd='/Users/epriestley/dev/core//run/local/phd'

STDOUT
(empty)

STDERR
[2014-12-23 14:05:26] EXCEPTION: (Exception) Specified daemon PID directory ('/Users/epriestley/dev/core//run/local/phd') does not exist or is not writable by the daemon user! at [<phutil>/src/daemon/PhutilDaemonOverseer.php:139]
  #0 PhutilDaemonOverseer::__construct(array) called at [<phabricator>/scripts/daemon/launch_daemon.php:26]
 at [<phutil>/src/future/exec/ExecFuture.php:397]
  #0 ExecFuture::resolvex() called at [<phabricator>/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:251]
  #1 PhabricatorDaemonManagementWorkflow::executeDaemonLaunchCommand(PhutilCommandString, string) called at [<phabricator>/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:230]
  #2 PhabricatorDaemonManagementWorkflow::launchDaemon(string, array, boolean) called at [<phabricator>/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:339]
  #3 PhabricatorDaemonManagementWorkflow::executeStartCommand(boolean) called at [<phabricator>/src/applications/daemon/management/PhabricatorDaemonManagementStartWorkflow.php:26]
  #4 PhabricatorDaemonManagementStartWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:394]
  #5 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:290]
  #6 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/daemon/manage_daemons.php:23]

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: fabe, epriestley

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

Details

Provenance
epriestleyAuthored on
epriestleyPushed on Dec 23 2014, 10:10 PM
Reviewer
btrahan
Differential Revision
D11040: Check daemon piddir writability before forking in daemons
Parents
rPHU103dc7e39093: Support Conduit tokens in ConduitClient
Branches
Unknown
Tags
Unknown