1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 20:10:55 +01:00

Fail explicitly instead of continuing with a warning if "phd.user" is misconfigured

Summary: Fixes T6806. We haven't seen users having issues with `phd.user` in a very long time.

Test Plan:
  - Configured daemons to run as `notepriestley`, got a well-explained exception.
  - Configured daemons to run as `epriestley`, got a clean start.
  - Configured daemons with `phd.user=null`, got a clean start.

Reviewers: chad, areitz

Reviewed By: areitz

Subscribers: areitz

Maniphest Tasks: T6806

Differential Revision: https://secure.phabricator.com/D15726
This commit is contained in:
epriestley 2016-04-15 13:50:42 -07:00
parent d9dd4d427d
commit f146f4577e

View file

@ -224,17 +224,18 @@ abstract class PhabricatorDaemonManagementWorkflow
$daemon_script_dir, $daemon_script_dir,
$config, $config,
$this->runDaemonsAsUser); $this->runDaemonsAsUser);
} catch (Exception $e) { } catch (Exception $ex) {
// Retry without sudo throw new PhutilArgumentUsageException(
$console->writeOut(
"%s\n",
pht( pht(
'%s command failed. Starting daemon as current user.', 'Daemons are configured to run as user "%s" in configuration '.
'sudo')); 'option `%s`, but the current user is "%s" and `phd` was unable '.
$this->executeDaemonLaunchCommand( 'to switch to the correct user with `sudo`. Command output:'.
$command, "\n\n".
$daemon_script_dir, '%s',
$config); $phd_user,
'phd.user',
$current_user,
$ex->getMessage()));
} }
} }
} }