Page MenuHomePhabricator

Check daemon piddir writability before forking in daemons

Authored by epriestley on Dec 23 2014, 10:07 PM.
Referenced Files
F12193742: D11040.id26514.diff
Sun, Sep 24, 3:55 AM
F12144252: D11040.diff
Thu, Aug 31, 1:58 AM
F12133377: D11040.id26515.diff
Aug 25 2023, 12:25 AM
F12130727: D11040.id26515.diff
Aug 23 2023, 1:10 PM
Unknown Object (File)
Aug 16 2023, 6:51 PM
Unknown Object (File)
Aug 4 2023, 7:00 AM
Unknown Object (File)
Jul 24 2023, 5:52 AM
Unknown Object (File)
Jul 16 2023, 4:53 AM



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!
exec ./phd-daemon 'PhabricatorRepositoryPullLocalDaemon' --daemonize --log='/Users/epriestley/dev/core//log/local/phd/daemons.log' --phd='/Users/epriestley/dev/core//run/local/phd' 


[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

rPHU libphutil
Lint Not Applicable
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.

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.