Phabricator 守护进程:`phd` 无法使用 `sudo` 切换到正确的用户
Phabricator Daemon: `phd` was unable to switch to the correct user with `sudo`
我目前正在尝试在 Raspberry Pi 上安装和 运行 Phabricator 供个人使用(尽管 Phacility 不推荐它,但我想我仍然会尝试一下)。到目前为止,我能够将除 phd 用户之外的所有内容设置为守护进程。
/etc/passwd
phd:x:1001:1001:,,,:/home/phd:/bin/bash
/etc/shadow
phd:NP:17107:0:99999:7:::
我创建了用户phd,并在shadow中给了im NP,但还是导致Phabricator在启动守护进程时无法切换到phd。
sudo ./bin/phd restart
Interrupting process 19517...
Process 19517 exited.
Freeing active task leases...
Freed 0 task lease(s).
Starting daemons as phd
Launching daemons:
(Logs will appear in "/var/tmp/phd/log/daemons.log".)
PhabricatorRepositoryPullLocalDaemon (Static)
PhabricatorTriggerDaemon (Static)
PhabricatorTaskmasterDaemon (Autoscaling: group=task, pool=4, reserve=0)
Usage Exception: Daemons are configured to run as user "phd" in
configuration option `phd.user`, but the current user is "root" and
`phd` was unable to switch to the correct user with `sudo`. Command output:
Command failed with error #255!
COMMAND
exec sudo -En -u 'phd' -- ./phd-daemon '--verbose'
STDOUT
(empty)
STDERR
[2016-11-04 08:54:54] EXCEPTION: (Exception) Specified daemon PID directory
('/var/tmp/phd/pid') does not exist or is not writable by the daemon user!
at [<phutil>/src/daemon/PhutilDaemonOverseer.php:115]
arcanist(head=master, ref.master=fad85844314b), phabricator(head=master,
ref.master=6982bded7124), phutil(head=master, ref.master=2b7b1007bf87)
#0 PhutilDaemonOverseer::__construct(array) called at
[<phabricator>/scripts/daemon/launch_daemon.php:13]
我尝试通过 su phd -c "/home/phd/phabricator/bin/phd restart"
启动 phd 用户,但它向我询问密码。
我一直关注这个指南https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/ as well as this https://gist.github.com/sparrc/b4eff48a3e7af8411fc1
非常非常感谢任何帮助!
我们平时运行
sudo -u phd ./bin/phd restart
感谢@JSON,他让我意识到我显然总是错过的一行,解决方案是:
sudo chmod go+w /var/tmp/phd/pid
这将使目录可写且对所有人免费,让我开始错误
我目前正在尝试在 Raspberry Pi 上安装和 运行 Phabricator 供个人使用(尽管 Phacility 不推荐它,但我想我仍然会尝试一下)。到目前为止,我能够将除 phd 用户之外的所有内容设置为守护进程。
/etc/passwd
phd:x:1001:1001:,,,:/home/phd:/bin/bash
/etc/shadow
phd:NP:17107:0:99999:7:::
我创建了用户phd,并在shadow中给了im NP,但还是导致Phabricator在启动守护进程时无法切换到phd。
sudo ./bin/phd restart
Interrupting process 19517...
Process 19517 exited.
Freeing active task leases...
Freed 0 task lease(s).
Starting daemons as phd
Launching daemons:
(Logs will appear in "/var/tmp/phd/log/daemons.log".)
PhabricatorRepositoryPullLocalDaemon (Static)
PhabricatorTriggerDaemon (Static)
PhabricatorTaskmasterDaemon (Autoscaling: group=task, pool=4, reserve=0)
Usage Exception: Daemons are configured to run as user "phd" in
configuration option `phd.user`, but the current user is "root" and
`phd` was unable to switch to the correct user with `sudo`. Command output:
Command failed with error #255!
COMMAND
exec sudo -En -u 'phd' -- ./phd-daemon '--verbose'
STDOUT
(empty)
STDERR
[2016-11-04 08:54:54] EXCEPTION: (Exception) Specified daemon PID directory
('/var/tmp/phd/pid') does not exist or is not writable by the daemon user!
at [<phutil>/src/daemon/PhutilDaemonOverseer.php:115]
arcanist(head=master, ref.master=fad85844314b), phabricator(head=master,
ref.master=6982bded7124), phutil(head=master, ref.master=2b7b1007bf87)
#0 PhutilDaemonOverseer::__construct(array) called at
[<phabricator>/scripts/daemon/launch_daemon.php:13]
我尝试通过 su phd -c "/home/phd/phabricator/bin/phd restart"
启动 phd 用户,但它向我询问密码。
我一直关注这个指南https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/ as well as this https://gist.github.com/sparrc/b4eff48a3e7af8411fc1
非常非常感谢任何帮助!
我们平时运行
sudo -u phd ./bin/phd restart
感谢@JSON,他让我意识到我显然总是错过的一行,解决方案是:
sudo chmod go+w /var/tmp/phd/pid
这将使目录可写且对所有人免费,让我开始错误