Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14032876
D9419.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9419.id.diff
View Options
diff --git a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
--- a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
+++ b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
@@ -55,25 +55,21 @@
$pid = $this->getPID();
if ($pid) {
- $console->writeErr(
- "Unable to start notifications server because it is already ".
- "running.\n");
- exit(1);
+ throw new PhutilArgumentUsageException(
+ pht(
+ 'Unable to start notifications server because it is already '.
+ 'running. Use `aphlict restart` to restart it.'));
}
if (posix_getuid() != 0) {
- $console->writeErr(
- "You must run this script as root; the Aphlict server needs to bind ".
- "to privileged ports.\n");
- exit(1);
+ throw new PhutilArgumentUsageException(
+ pht(
+ 'You must run this script as root; the Aphlict server needs to bind '.
+ 'to privileged ports.'));
}
- if (!Filesystem::binaryExists('node')) {
- $console->writeErr(
- "`node` is not in \$PATH. You must install Node.js to run the Aphlict ".
- "server.\n");
- exit(1);
- }
+ // This will throw if we can't find an appropriate `node`.
+ $this->getNodeBinary();
}
final protected function launch($debug = false) {
@@ -108,7 +104,8 @@
}
$command = csprintf(
- 'node %s %C',
+ '%s %s %C',
+ $this->getNodeBinary(),
dirname(__FILE__).'/../../../../support/aphlict/server/aphlict_server.js',
implode(' ', $server_argv));
@@ -201,4 +198,19 @@
return 0;
}
+ private function getNodeBinary() {
+ if (Filesystem::binaryExists('nodejs')) {
+ return 'nodejs';
+ }
+
+ if (Filesystem::binaryExists('node')) {
+ return 'node';
+ }
+
+ throw new PhutilArgumentUsageException(
+ pht(
+ 'No `nodejs` or `node` binary was found in $PATH. You must install '.
+ 'Node.js to start the Aphlict server.'));
+ }
+
}
diff --git a/src/applications/notification/setup/PhabricatorSetupCheckAphlict.php b/src/applications/notification/setup/PhabricatorSetupCheckAphlict.php
--- a/src/applications/notification/setup/PhabricatorSetupCheckAphlict.php
+++ b/src/applications/notification/setup/PhabricatorSetupCheckAphlict.php
@@ -57,7 +57,7 @@
->setShortName(pht('Notification Server Version'))
->setName(pht('Notification Server Out of Date'))
->setMessage($message)
- ->addCommand('phabricator/ $ sudo ./bin/aphlict start');
+ ->addCommand('phabricator/ $ sudo ./bin/aphlict restart');
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 10, 4:05 PM (2 d, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6718573
Default Alt Text
D9419.id.diff (2 KB)
Attached To
Mode
D9419: Try `nodejs` before `node` when starting notification server
Attached
Detach File
Event Timeline
Log In to Comment