@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #176 from nexeck/master

D3149: The Log and PID directory should be separable in the config file

+22 -10
+4 -1
conf/default.conf.php
··· 1095 1095 1096 1096 // Directory that phd (the Phabricator daemon control script) should use to 1097 1097 // track running daemons. 1098 - 'phd.pid-directory' => '/var/tmp/phd', 1098 + 'phd.pid-directory' => '/var/tmp/phd/pid', 1099 + 1100 + // Directory that the Phabricator daemons should use to store the log file 1101 + 'phd.log-directory' => '/var/tmp/phd/log', 1099 1102 1100 1103 // Number of "TaskMaster" daemons that "phd start" should start. You can 1101 1104 // raise this if you have a task backlog, or explicitly launch more with
+1 -1
scripts/daemon/phabricator_daemon_launcher.php
··· 225 225 echo "Staging launch...\n"; 226 226 $control->pingConduit(); 227 227 if ($with_logs) { 228 - $log_dir = $control->getControlDirectory('log').'/daemons.log'; 228 + $log_dir = $control->getLogDirectory().'/daemons.log'; 229 229 echo "NOTE: Logs will appear in '{$log_dir}'.\n\n"; 230 230 } 231 231 }
+17 -8
src/infrastructure/daemon/PhabricatorDaemonControl.php
··· 254 254 $flags[] = csprintf('--conduit-uri=%s', PhabricatorEnv::getURI('/api/')); 255 255 256 256 if (!$debug) { 257 - $log_dir = $this->getControlDirectory('log').'/daemons.log'; 258 - $flags[] = csprintf('--log=%s', $log_dir); 257 + $log_file = $this->getLogDirectory().'/daemons.log'; 258 + $flags[] = csprintf('--log=%s', $log_file); 259 259 } 260 260 261 - $pid_dir = $this->getControlDirectory('pid'); 261 + $pid_dir = $this->getPIDDirectory(); 262 262 263 263 // TODO: This should be a much better user experience. 264 264 Filesystem::assertExists($pid_dir); ··· 295 295 return; 296 296 } 297 297 298 - public function getControlDirectory($dir) { 299 - $path = PhabricatorEnv::getEnvConfig('phd.pid-directory').'/'.$dir; 298 + private function getControlDirectory($path) { 300 299 if (!Filesystem::pathExists($path)) { 301 300 list($err) = exec_manual('mkdir -p %s', $path); 302 301 if ($err) { 303 302 throw new Exception( 304 303 "phd requires the directory '{$path}' to exist, but it does not ". 305 304 "exist and could not be created. Create this directory or update ". 306 - "'phd.pid-directory' in your configuration to point to an existing ". 307 - "directory."); 305 + "'phd.pid-directory' / 'phd.log-directory' in your configuration ". 306 + "to point to an existing directory."); 308 307 } 309 308 } 310 309 return $path; 311 310 } 312 311 312 + public function getPIDDirectory() { 313 + $path = PhabricatorEnv::getEnvConfig('phd.pid-directory'); 314 + return $this->getControlDirectory($path); 315 + } 316 + 317 + public function getLogDirectory() { 318 + $path = PhabricatorEnv::getEnvConfig('phd.log-directory'); 319 + return $this->getControlDirectory($path); 320 + } 321 + 313 322 protected function loadAvailableDaemonClasses() { 314 323 $loader = new PhutilSymbolLoader(); 315 324 return $loader ··· 321 330 public function loadRunningDaemons() { 322 331 $results = array(); 323 332 324 - $pid_dir = $this->getControlDirectory('pid'); 333 + $pid_dir = $this->getPIDDirectory(); 325 334 $pid_files = Filesystem::listDirectory($pid_dir); 326 335 if (!$pid_files) { 327 336 return $results;