CTLA study materials
CTLA study resources

CTLA: Service Management and Process Control

CTLA · Work through your exam, one topic at a time.

All guide sections

Service Management and Process Control

This domain covers systemd as the service and dependency manager, the journal as its logging backend, and the process primitives underneath: signals, priorities, and scheduling. CTLA items typically ask why a configuration change had no effect, or how to make a service start at boot and restart on failure.

Units and systemctl

The unit types that matter are .service, .timer, .socket, .mount, and .target. Vendor units live in /usr/lib/systemd/system, local overrides in /etc/systemd/system. systemctl start runs a unit now; systemctl enable only creates symlinks into the target's .wants directory for boot. systemctl mask links the unit to /dev/null, preventing any start including dependency-driven ones.

Unit file anatomy

[Unit]: Description, After=, Requires= (hard dependency), Wants= (soft). [Service]: Type=simple|oneshot|forking, ExecStart=, Restart=on-failure, User=, EnvironmentFile=. [Install]: WantedBy=multi-user.target. After editing any unit, run systemctl daemon-reload; reload re-reads the service's own config without restarting, restart bounces the process.

Journal and scheduling

journalctl -u sshd -p err -b --since "1 hour ago" -f is the standard diagnostic combination; persistence requires Storage=persistent in journald.conf. Timers use OnCalendar= and Persistent=true to catch up on missed runs; they need both enable and start. Cron reads /etc/crontab, /etc/cron.d, and per-user crontabs - with a minimal environment, so scripts must set PATH and source what they need.

Processes and signals

ps aux / ps -ef, pgrep, pstree, top. Niceness runs -20 (most favoured) to 19; renice -n 5 -p PID. Signals: SIGTERM (15) requests graceful shutdown, SIGHUP (1) often means reload, SIGKILL (9) cannot be caught and skips cleanup. cgroups v2 limits are set through systemd (MemoryMax=, CPUQuota=).

Worked example

An administrator edits ExecStart= in a unit file and runs systemctl restart myapp. The old command still runs. Reasoning: systemd reads the unit file at load time, so restart alone reuses the cached definition. The sequence is systemctl daemon-reload, then systemctl restart myapp, then systemctl status myapp to confirm the new PID and command line. If a drop-in exists in /etc/systemd/system/myapp.service.d/, check it too - later-sorting drop-ins win.

Traps

  • Believing enable implies start, or the reverse.
  • Using kill -9 first, leaving temporary files and locks behind.
  • Expecting cron jobs to inherit your interactive PATH.
  • Forgetting daemon-reload after unit edits.
  • Assuming restart and reload are interchangeable.