User Tools

Site Tools


linux:centos:services

Create service file for an application

We'll use phabricator app as example. It should run after the mysql database was started.

Create the file phabricator-phd.service in /usr/lib/systemd/system/ folder.

phabricator-phd.service
[Unit]
Description=Phabricator Daemons
After=syslog.target
After=network.target
After=mariadb.service
 
[Service]
Type=forking
User=apache
Group=apache
ExecStart=/var/www/html/phabricator/phabricator/bin/phd start
ExecStop=/var/www/html/phabricator/phabricator/bin/phd stop
Restart=always
RestartSec=10
StartLimitInterval=0
StartLimitBurst=0
[Install]
WantedBy=multi-user.target

Enable it at startup:

systemctl enable phabricator-phd.service

Run it:

systemctl start phabricator-phd
linux/centos/services.txt · Last modified: 2023/07/04 19:36 by 127.0.0.1