Interview Prep/Linux/Processes, Signals & systemd

Where do unit files live and which takes precedence?

IntermediateConceptProcesses, Signals & systemd
Answer

From highest to lowest precedence: /etc/systemd/system/ (admin), /run/systemd/system/ (runtime), /usr/lib/systemd/system/ (packages). Never edit package units in /usr/lib; they get overwritten on upgrade. Use a drop-in:

sudo systemctl edit nginx        # creates /etc/systemd/system/nginx.service.d/override.conf
systemctl cat nginx              # shows unit plus all drop-ins
All Linux questions Roadmap: Linux

More on Processes, Signals & systemd