World map

 

BM: Baca dalam Bahasa Melayu

World L2: Keys & Staff

Logs with journalctl

You will learn: to read a service's diary and find the one line that says what went wrong.

Checked with Linux (Debian 13) on 1 Nov 2026

The problem

systemctl is-active nginx says failed. The web server tried to start this morning and gave up. Where did it say why?

Pick one answer.

Watch

You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx failed.

You are hereyou@kedai:~$

Folder ~

Empty folder

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxfailedstarts at boot

The journal: systemd's diary of what every service said and did. journalctl reads it. is the shift manager’s diary. -u nginx keeps nginx’s lines. -n 5 shows the last five. Find the [emerg] line.

Predict

Without sudo, journalctl -u nginx shows a Hint and no nginx lines. Why?

Pick one answer.

Check

Tap the line that says what actually broke.

0 of 1 found

Check

Which switch do you need?

Drag a card into a box. Or tap the card, then tap the box.

        Check

        The diary blames line 44, but line 41 reads root /var/www/html with no ;. What fixes it?

        Pick one answer.

        You did it!

        You can now read a service’s diary and find the line that matters.

        Go deeper (optional)

        systemd’s own error message suggests journalctl -xeu nginx.service: -x adds help text and -e jumps to the end. Errors often point one line late, as here. The boss fixes a broken nginx with all of this.

        Real rep (optional): on a Debian or Ubuntu VM, sudo journalctl -u ssh -n 10 shows recent logins.