linux_wiki:systemd_service_script

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:systemd_service_script [2018/03/23 14:52]
billdozor
linux_wiki:systemd_service_script [2019/05/25 23:50] (current)
Line 141: Line 141:
 WantedBy=multi-user.target WantedBy=multi-user.target
 </code> </code>
 +
 +----
 +
 +===== Example: Apache HTTPD Compiled =====
 +
 +Creating a service unit file for a locally compiled and installed Apache web server.
 +
 +\\
 +/etc/systemd/system/httpd-local.service
 +<code bash>
 +[Unit]
 +Description=Apache Web Server
 +After=network.target remote-fs.target nss-lookup.target
 +
 +[Service]
 +Type=forking
 +PIDFile=/usr/local/apache2/logs/httpd.pid
 +ExecStart=/usr/local/apache2/bin/apachectl start
 +ExecStop=/usr/local/apache2/bin/apachectl graceful-stop
 +ExecReload=/usr/local/apache2/bin/apachectl graceful
 +PrivateTmp=true
 +LimitNOFILE=infinity
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +\\
 +Reload systemd<code bash>systemctl daemon-reload</code>
 +
 +\\
 +Enable/start service<code bash>systemctl enable httpd-local
 +systemctl start httpd-local</code>
  
 ---- ----
  • linux_wiki/systemd_service_script.1521831135.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)