Page MenuHomePhabricator

Check daemon piddir writability before forking in daemons
ClosedPublic

Authored by epriestley on Dec 23 2014, 10:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 1:46 AM
Unknown Object (File)
Fri, Dec 13, 8:18 PM
Unknown Object (File)
Wed, Dec 11, 10:36 PM
Unknown Object (File)
Sat, Dec 7, 11:13 PM
Unknown Object (File)
Wed, Dec 4, 9:51 AM
Unknown Object (File)
Mon, Dec 2, 8:16 PM
Unknown Object (File)
Sat, Nov 30, 11:24 AM
Unknown Object (File)
Fri, Nov 29, 6:25 PM
Subscribers

Details

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]

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Check daemon piddir writability before forking in daemons.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
epriestley added a subscriber: fabe.
btrahan edited edge metadata.
btrahan added inline comments.
src/daemon/PhutilDaemonOverseer.php
147

comment trails off

This revision is now accepted and ready to land.Dec 23 2014, 10:08 PM
This revision was automatically updated to reflect the committed changes.