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
F13213429: D11040.diff
Fri, May 17, 7:45 AM
F13191291: D11040.id.diff
Sat, May 11, 7:08 PM
Unknown Object (File)
Tue, May 7, 6:57 AM
Unknown Object (File)
Sat, May 4, 8:05 AM
Unknown Object (File)
Fri, May 3, 4:52 AM
Unknown Object (File)
Thu, Apr 25, 12:40 AM
Unknown Object (File)
Apr 20 2024, 9:32 AM
Unknown Object (File)
Apr 16 2024, 11:17 AM
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.