quick-docs/en-US/modules/proc_modifying-existing-systemd-services.adoc

45 lines
1.2 KiB
Text
Raw Normal View History

[#modifying-existing-systemd-services]
= 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.
* 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.