Place a local systemd unit or an override for a vendor unit.
Use the administrator directory with higher priority than vendor-provided units.
Which path is appropriate?
/etc/systemd/system is the administrator-managed unit directory and has higher priority than vendor areas such as /usr/lib/systemd/system.
Detailed explanation
/etc/systemd/system/Correct. /etc/systemd/system is the administrator-priority unit directory.
Correct. /etc/systemd/system is the administrator-priority unit directory.
/usr/lib/systemd/system/Incorrect. /usr/lib/systemd/system is normally for vendor-provided units.
Incorrect. /usr/lib/systemd/system is normally for vendor-provided units.
/proc/systemd/system/Incorrect. /proc exposes kernel and process information, not persistent systemd units.
Incorrect. /proc exposes kernel and process information, not persistent systemd units.
/boot/systemd/system/Incorrect. /boot contains boot artifacts rather than normal unit configuration.
Incorrect. /boot contains boot artifacts rather than normal unit configuration.
Try it yourself
An example you can run in a temporary verification environment.
systemd-path systemd-system-unit 2>/dev/null || printf '%s
' /etc/systemd/systemExpected result
/etc/systemd/systemKey points
- /etc holds administrator configuration
- /usr/lib is a vendor area
- Drop-ins can override selected settings
Notes
- Environment: Linux / systemd 255以降
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.