CELE study materials
CELE study resources

CELE: Processes, jobs, and system services

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

All guide sections

Processes, jobs, and system services

This domain, Processes, jobs, and system services, covers how programs become processes, how to inspect and signal them, how shell job control differs from persistent services, and how systemd supervises daemons.

Processes and signals

  • A process has a PID and a PPID; fork clones it and exec replaces the image. Common states are R (running), S (sleeping), D (uninterruptible), Z (zombie), and T (stopped).
  • Inspect with ps aux, ps -ef --forest, top, pgrep -a, and pidof.
  • Signals: SIGTERM (15, polite default), SIGKILL (9, cannot be caught), SIGHUP (1, often reload), SIGSTOP and SIGCONT.
  • Priority: nice -n 10 cmd starts with lower priority; renice -n 5 -p PID adjusts a running process. Lower nice values mean higher priority.

Jobs and services

  • Shell jobs: cmd &, jobs, fg %1, bg %1, Ctrl-Z, disown. Jobs die with the shell unless you use nohup cmd & or a terminal multiplexer.
  • systemd units include .service, .timer, .socket, and .mount. Use systemctl start, stop, restart, reload, status, enable, disable, mask.
  • enable creates boot-time symlinks; start acts only now. Logs come from journalctl -u sshd -b --since '1 hour ago'.

Worked example

A daemon ignores systemctl stop. Reasoning: systemd sent SIGTERM and the process did not exit within TimeoutStopSec. Check systemctl status and journalctl -u name; if the process is stuck in D state, investigate I/O before forcing anything. You can send another signal with systemctl kill -s SIGKILL name, or adjust KillSignal and TimeoutStopSec in a drop-in created by systemctl edit name. Keep SIGKILL as a last resort because it prevents cleanup.

Traps

  • Reaching for kill -9 first.
  • Believing systemctl start survives a reboot.
  • Editing a unit file without systemctl daemon-reload.
  • Confusing a zombie, which is already dead and waiting for its parent, with a running process.