You need to change only the ExecStart line of the vendor-supplied apache2.service unit and ensure the modification survives future package upgrades. According to systemd's unit search order, in which exact path should you place the custom override file so that it takes precedence while leaving the original file untouched?
Systemd always loads unit files from several directories in a defined precedence. Files or drop-in snippets found in /etc/systemd/system override those shipped by the distribution in /usr/lib (or /lib) and are preserved across package upgrades. The recommended way to modify a single setting is to create a drop-in directory that matches the unit name and place a .conf file inside it. Therefore an override for apache2.service must be stored as /etc/systemd/system/apache2.service.d/override.conf. A file under /usr/lib would be replaced on the next package update, /run is only temporary, and /etc/systemd/override.d is not part of the unit search path.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a systemd unit file?
Open an interactive chat with Bash
Why are files in /etc/systemd/system preserved across updates?
Open an interactive chat with Bash
What is the purpose of drop-in files like override.conf?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access