Interview Prep/Linux/Processes, services and systemd

Developers want to see the logs of only their service from the last hour, without sudo. How?

BeginnerScenarioProcesses, services and systemd
Answer

Situation read → journald access for non-root users.

What I'd do →

sudo usermod -aG systemd-journal alice
# then alice runs:
journalctl -u api --since "1 hour ago" --no-pager
journalctl -u api -p err -f

Why → Members of systemd-journal (and adm on Debian/Ubuntu) can read the system journal.

Interview tip → Mention --since, -p priority and -o json for scripts.

All Linux questions Roadmap: Linux

More on Processes, services and systemd