Interview Prep/Linux/Processes, services and systemd

You need to run a nightly job as a specific user only while they're not logged in, and it should start even if they never log in. How?

AdvancedScenarioProcesses, services and systemd
Answer

Situation read → User-level systemd services need lingering.

What I'd do →

sudo loginctl enable-linger builder
sudo -iu builder
mkdir -p ~/.config/systemd/user
# create job.service and job.timer there
systemctl --user daemon-reload
systemctl --user enable --now job.timer

Why → Without lingering, the user's systemd manager only runs while they have a session, so user units stop at logout.

Interview tip → This is also how rootless Podman containers keep running after logout.

All Linux questions Roadmap: Linux

More on Processes, services and systemd