Quantcast
Channel: Modify systemd unit file without altering upstream unit file - Server Fault
Viewing all articles
Browse latest Browse all 4

Answer by Henrik Pingel for Modify systemd unit file without altering upstream unit file

$
0
0

The RHEL documentation recommends two ways:

  1. Extend the default unit file by creating a configuration directory and file under /etc/systemd/system/[name-goes-here].service.d/config_name.conf

In this case the file would need to contain something like this:

[Service]Restart=always

This is what systemctl edit [name-goes-here] does, it creates that directory and override.conf within it.

  1. Create a copy of the original unit file /usr/lib/systemd/system/ in /etc/systemd/system/ and make changes there.

I would try option one but they are both viable options. Either way remember to run systemctl daemon-reload after making the changes.

RHEL documentation on Creating and Modifying systemd Unit Files


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images