From 972604e0e59ca0dd43cac7fe8e83574ba2870b3f Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 15 Dec 2016 13:36:06 -0800 Subject: [PATCH] Set `TERM` to prevent `No entry for terminal type "unknown"` messages during fetch Summary: Fetches cause output in `/var/tmp/phd/log/daemons.log` as follows: ``` PHLOG: 'Unexpected output while updating repository "rREPONAME": No entry for terminal type "unknown"; using dumb terminal settings. ' at [/path/to/phabricator/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:455] ``` These warnings come from PHP itself. Silence these warnings by providing a known value for `TERM` before shelling out to the PHP script. See also D9744 (reverted in D11644) and T4990/T7119, which are a similar issue, but in the pre-receive hooks, not the pull daemons. Test Plan: Enabled in production, observed errors to be silenced and no SSH hangs Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D17100 --- .../daemon/PhabricatorRepositoryPullLocalDaemon.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php index 9cbb8db8e9..fe19849163 100644 --- a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php +++ b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php @@ -272,6 +272,11 @@ final class PhabricatorRepositoryPullLocalDaemon $future->setTimeout($timeout); + // The default TERM inherited by this process is "unknown", which causes PHP + // to produce a warning upon startup. Override it to squash this output to + // STDERR. + $future->updateEnv('TERM', 'dumb'); + return $future; }