尝试启动 Notification Server 时出错

Ale*_*ekh 2 phabricator

我试图启动 Phabricator 的Notification Server,但遇到以下错误:

/phabricator/phabricator/bin/aphlict start

[2015-11-16 18:41:08] EXCEPTION: (FilesystemException) Requested path '/var/tmp/aphlict/pid' is not writable. at [<phutil>/src/filesystem/Filesystem.php:1081]
arcanist(head=master, ref.master=9dd6eafb5254), phabricator(head=master, ref.master=50d158a8c4d9), phutil(head=master, ref.master=e9ed72483a14)
  #0 Filesystem::assertWritable(string) called at [<phutil>/src/filesystem/Filesystem.php:73]
  #1 Filesystem::assertWritableFile(string) called at [<phutil>/src/filesystem/Filesystem.php:89]
  #2 Filesystem::writeFile(string, string) called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:140]
  #3 PhabricatorAphlictManagementWorkflow::willLaunch() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:249]
  #4 PhabricatorAphlictManagementWorkflow::executeStartCommand() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementStartWorkflow.php:15]
  #5 PhabricatorAphlictManagementStartWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
  #6 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
  #7 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/support/aphlict/server/aphlict_launcher.php:23]
Run Code Online (Sandbox Code Playgroud)

有问题的目录似乎是可写的:

ls -l /var/tmp/aphlict

total 4
drwxr-xr-x 2 root root 4096 Nov 16 13:40 pid
Run Code Online (Sandbox Code Playgroud)

如果重要的话,我在 Ubuntu 14.04 LTS 系统上以非“root”身份运行所有操作。

Ale*_*ekh 5

我刚刚想通了这一点。正如我在最近的更新中所说,我试图以非“root”身份启动通知服务器。再次查看/var/tmp/aphlict/pid文件夹的权限,问题突然变得清晰而微不足道。

ls -l /var/tmp/aphlict

total 4
drwxr-xr-x 2 root root 4096 Nov 16 13:40 pid
Run Code Online (Sandbox Code Playgroud)

因此,解决问题所需要做的就是使目录对每个人都可写(我希望这种方法不会造成潜在的安全问题):

chmod go+w /var/tmp/aphlict/pid

su MY_NON_ROOT_USER_NAME -c './bin/aphlict start'
Aphlict Server started.
Run Code Online (Sandbox Code Playgroud)

问题解决了。顺便说一句,为了使Notification Server正常工作,除了已经打开的22280之外,还需要打开22281端口吗?(请在评论中回答。谢谢!)