Services and User Management

A package-provided unit file at /usr/lib/systemd/system/nginx.service needs an extra Environment= setting for the nginx service. The change must survive package updates. What is the best way to apply it?

Show the answer

Correct answerC. Run systemctl edit nginx to add a drop-in override, then restart the service

systemctl edit creates a drop-in file under /etc/systemd/system/nginx.service.d/, which overrides the packaged unit and is not replaced by updates. Editing the file in /usr/lib is tempting, but a package update can overwrite it.