Services, boot and logs

Learning objectives

Check whether a service is running, determine whether it starts at boot, and read relevant journal entries without changing the service.

1 Objective→ 2 Learn→ 3 Example→ 4 Practice→ 5 Verify→ 6 Continue
How to study this lessonUnderstand the idea first. Use the example to see the behaviour, practise where provided, then make sure you can explain the result before continuing.

Explanation

Service state

Linux starts the kernel and then a service manager. On the reference system, systemd manages units. A service unit represents a background service; a timer unit schedules work.

“Active” and “enabled” answer different questions:

  • Active means the unit is running now.
  • Enabled means it is configured to start through its normal boot dependencies.

Commands you will use

Command What it does Example
systemctl status Shows current state and recent messages. systemctl status sshd --no-pager
systemctl is-active Returns whether a unit is active now. systemctl is-active sshd
systemctl is-enabled Returns whether a unit is enabled for boot. systemctl is-enabled sshd
journalctl -u Reads journal messages for one unit. journalctl -u sshd -n 20
journalctl -b Reads messages from the current boot. journalctl -b -p warning
timedatectl Shows clock and time-zone state. timedatectl status

Commands such as start, stop, restart, enable, and disable change system state. Do not use them on shared services without authorization.

Worked example

systemctl is-active systemd-journald
systemctl is-enabled systemd-journald
systemctl status systemd-journald --no-pager
journalctl -u systemd-journald -n 10 --no-pager
timedatectl status

Expected result: the first two commands report current and boot state separately. Journal access may be limited for an ordinary user; that permission message is a valid result.

RTL/DV use

License managers, job schedulers, remote access, and shared storage may depend on services. Collect state and logs before requesting an administrator to restart anything.

Common mistakes

  • Treating “enabled” as proof that a service is currently running.
  • Restarting a shared service before collecting failure evidence.
  • Using sudo only to suppress a journal permission message.
  • Comparing logs without checking their timestamps and time zone.

Check yourself

How does is-active differ from is-enabled?

Engineering practice

Practice: Services, boot and logs

Task→Run / reason→Check result→Explain why

Inspect one readable service. Record whether it is active and enabled, plus one timestamped journal observation or the exact access restriction.

Practice work is non-certified and is not stored by ASIC Campus.