User Tools

Site Tools


linux:centos:services

This is an old revision of the document!


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.1520108432.txt.gz · Last modified: 2023/07/04 19:36 (external edit)