mitchellroe.dev

Add “drop-in” unit files in systemd

From https://wiki.archlinux.org/title/Systemd#Drop-in_files

2.3.2 Drop-in files

To create drop-in files for the unit file /usr/lib/systemd/system/unit, create the directory /etc/systemd/system/unit.d/ and place .conf files there to override or add new options. systemd will parse and apply these files on top of the original unit.

The easiest way to do this is to run:

# systemctl edit unit --drop-in=drop_in_name

This opens the file /etc/systemd/system/unit.d/drop_in_name.conf in your text editor (creating if necessary) and automatically reloads the unit when you are done editing. Omitting the --drop-in= option will result in systemd using the default file name override.conf.

Note:

2.3.3 Revert to vendor version

To revert any changes to a unit made using systemctl edit do:

# systemctl revert unit