user6576155
user6576155

Reputation:

Phabricator Daemon: `phd` was unable to switch to the correct user with `sudo`

I am currently trying to install and run Phabricator on a Raspberry Pi for personal use (even though It's not recommended by Phacility, I thought I still give it a try). So far, I was able to setup everything except the phd user as daemon.

/etc/passwd

phd:x:1001:1001:,,,:/home/phd:/bin/bash

/etc/shadow

phd:NP:17107:0:99999:7:::

I created the user phd and gave im NP in shadow, but that still makes Phabricator unable to switch to phd when starting the daemon.

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]

What I tried is starting the phd user via su phd -c "/home/phd/phabricator/bin/phd restart" but that queries a password from me.

I kept close to this guide https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/ as well as this https://gist.github.com/sparrc/b4eff48a3e7af8411fc1

Any help is really, really appreciated!

Upvotes: 1

Views: 1673

Answers (2)

CEPA
CEPA

Reputation: 2602

We usually run

sudo -u phd ./bin/phd restart

Upvotes: 0

user6576155
user6576155

Reputation:

Thanks to @JSON who just made me aware of a line that I apparently always missed, the solution was:

sudo chmod go+w /var/tmp/phd/pid

This will make the directoy writeable and free for all and let me start the error

Upvotes: 2

Related Questions