The RHEL documentation recommends two ways:
- 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.
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