quick-docs/modules/ROOT/pages/_partials/proc_modifying-existing-systemd-services.adoc

45 lines
1.2 KiB
Text
Raw Normal View History

[#modifying-existing-systemd-services]
2018-02-26 16:43:59 +00:00
= Modifying existing systemd services
This example shows how to modify an existing service. The files for service modification are stored in a directory within `/etc/systemd/system`. This directory is named after the service. For example, this procedure modifies the `httpd` service.
.Prerequisites
* You are logged in as a user with administrator-level permissions.
2018-02-26 16:43:59 +00:00
* You have a configured `httpd` server running through systemd.
.Procedure
. Create a directory for the service modification in the following format: `[SERVICE NAME].service.d`. For example, the directory for the `httpd.service` modification is `httpd.service.d`:
+
----
2018-01-21 17:04:05 +00:00
# mkdir /etc/systemd/system/httpd.service.d/
----
. Create a configuration file within this directory:
+
----
2018-01-21 17:04:05 +00:00
# vi /etc/systemd/system/httpd.service.d/custom.conf
----
. Add your custom configuration. For example:
+
----
[Service]
Restart=always
RestartSec=30
----
. Save the file.
. Restart the `httpd` service:
+
----
2018-01-21 17:04:05 +00:00
# systemctl restart httpd
----
.Related Information
2018-01-21 17:04:05 +00:00
* See link:#common-service-parameters[Common service parameters] for more information about the parameters used in this procedure.