Problem Statement
What is systemd in modern Linux systems?
Explanation
Systemd is the init system (PID 1) in most modern Linux distributions, replacing older init systems (SysV init, Upstart). Responsibilities: booting system, starting/stopping services, managing dependencies, logging (journald), device management (udev). Units: services (.service), mounts (.mount), timers (.timer), targets (.target, like runlevels).
Boots to target: multi-user.target (multi-user text mode), graphical.target (GUI). View targets: systemctl list-units --type=target. Change: systemctl isolate multi-user.target. Default: systemctl get-default, systemctl set-default graphical.target.
Service management: systemctl start/stop/restart/reload service, systemctl enable/disable (auto-start), systemctl status (show status), systemctl list-units --type=service (list all services). View logs: journalctl -u service.
Older systems use SysV init: scripts in /etc/init.d/, runlevels (0-6), service command or /etc/init.d/script start. Understanding systemd is crucial for managing modern Linux systems.
