mirror of
https://pagure.io/fedora-docs/quick-docs.git
synced 2024-12-01 07:39:48 +00:00
44 lines
1.2 KiB
Text
44 lines
1.2 KiB
Text
[#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`:
|
|
+
|
|
----
|
|
# mkdir /etc/systemd/system/httpd.service.d/
|
|
----
|
|
|
|
. Create a configuration file within this directory:
|
|
+
|
|
----
|
|
# 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:
|
|
+
|
|
----
|
|
# systemctl restart httpd
|
|
----
|
|
|
|
.Related Information
|
|
|
|
* See link:#common-service-parameters[Common service parameters] for more information about the parameters used in this procedure.
|