User Tools

Site Tools


linux:centos:services

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:centos:services [2018/03/03 22:13] – created odeftalinux:centos:services [2023/07/04 19:36] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Create service file for an application ====== ====== Create service file for an application ======
  
-  We'll use phabricator app as example. It should run after the mysql database was started.+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.+Create the file phabricator-phd.service in **/usr/lib/systemd/system/** folder.
      
-  <file service phabricator-phd.service> +<file txt phabricator-phd.service> 
-  [Unit] +[Unit] 
-  Description=Phabricator Daemons +Description=Phabricator Daemons 
-  After=syslog.target +After=syslog.target 
-  After=network.target +After=network.target 
-  After=mariadb.service +After=mariadb.service 
-   + 
-  [Service] +[Service] 
-  Type=forking +Type=forking 
-  User=apache +User=apache 
-  Group=apache +Group=apache 
-  ExecStart=/var/www/html/phabricator/phabricator/bin/phd start +ExecStart=/var/www/html/phabricator/phabricator/bin/phd start 
-  ExecStop=/var/www/html/phabricator/phabricator/bin/phd stop +ExecStop=/var/www/html/phabricator/phabricator/bin/phd stop 
-  Restart=always +Restart=always 
-  RestartSec=10 +RestartSec=10 
-  StartLimitInterval=0 +StartLimitInterval=0 
-  StartLimitBurst=0 +StartLimitBurst=0 
-   +[Install] 
-  [Install] +WantedBy=multi-user.target 
-  WantedBy=multi-user.target +</file> 
-  </file>+ 
 +Enable it at startup: 
 + 
 +  systemctl enable phabricator-phd.service 
 + 
 +Run it: 
 + 
 +  systemctl start phabricator-phd 
  
linux/centos/services.1520107984.txt.gz · Last modified: 2023/07/04 19:36 (external edit)