How to start phd automatically?


#1

After every reboot I get unresolved issue “daemons not running”, and start them manually via SSH:

sudo /usr/share/nginx/html/phabricator/bin/phd start

How can I make phd start at bootup?

I tried to create a service for systemd (in my Webmin, CentOS 7), but for some reason it doesn’t work:

[Unit]
Description=Phabricator engine

[Service]
ExecStart=/usr/share/nginx/html/phabricator/bin/phd start
ExecReload=/usr/share/nginx/html/phabricator/bin/phd restart
ExecStop=/usr/share/nginx/html/phabricator/bin/phd stop

[Install]
WantedBy=multi-user.target

Does it need some PID or specific user/group?
Or should I put start instructions somewhere else?
I’m not a linux specialist, so excuse me for a newbie question, but I found nothing about it in docs.
Thank you!


#2

The daemons need to run as the daemon-user which you chose when setting up according to https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/

In my systemd unit, I also have Type=forking, which is probably important, as without it systemd will assume that the ExecStart command lives on as the server, and when it finishes the server has stopped.

Here is my complete unit file:

[Unit]
Description=Phabricator Daemons
After=network.target,mysql.service
Requires=network.target,mysql.service

[Service]
Type=forking
User=phd
Group=backup
ExecStart=/var/www/phabricator/bin/phd start
ExecStop=/var/www/phabricator/bin/phd stop
Restart=always
RestartSec=10
StartLimitInterval=0
StartLimitBurst=0

[Install]
WantedBy=multi-user.target

#3

Thank you, @jsonr

It seems there was also the problem that daemon user had no permission to write

/var/tmp/phd

I changed the ownership, and now it works.


#4