Frequently Asked Question
What is a drop-in override and how is it different from editing a unit file?
A drop-in is a small partial unit file that supplements an existing one. Instead of
editing (and therefore replacing) the vendor-shipped unit at /usr/lib/systemd/system/ nginx.service, you create a directory /etc/systemd/system/nginx.service.d/ and put
.conf files inside it. systemd merges them on top of the original unit. The shortcut
is sudo systemctl edit nginx, which opens an editor on an override file in the right
place and runs daemon-reload for you when you save.
Drop-ins are the right way to customise a packaged service: they survive package
upgrades (the vendor unit can be updated without losing your changes), they make your
modifications easy to find and audit, and they keep the original unit intact for
reference. systemctl cat nginx prints the effective merged unit so you can see what
systemd is actually using. To replace a single directive entirely, set it to empty
first (e.g. ExecStart= then ExecStart=/new/command) because some directives
otherwise accumulate.