1 of 15

systemd 101

Steven Pritchard

Southern Illinois Linux Users Group

2 of 15

What is systemd?

systemd is a modern init implementation for Linux designed to start fewer services in parallel.

3 of 15

What problems does systemd solve?

  • Service dependencies
  • Starting services on-demand
  • Early syslog
  • Output of daemons is preserved
  • Tracks cgroups
  • Tracks and manages mount points
  • System snapshots and restores

4 of 15

What problems does systemd solve?

  • Manages hostname, locale, and other system-wide settings
  • Predictable service environment
  • Offline system updates
  • Faster boot process
  • Shell-free boot

5 of 15

What does systemd replace?

  • init (etc.)
  • udev
  • pm-utils
  • inetd
  • acpid
  • crond/atd
  • ConsoleKit
  • automount
  • watchdog
  • syslog

6 of 15

Managing Runlevels

$ ls -ld /etc/systemd/system/default.target�lrwxrwxrwx. 1 root root 36 Oct 28 2010 /etc/systemd/system/default.target -> /lib/systemd/system/runlevel5.target�$ ls -ld /lib/systemd/system/runlevel5.target�lrwxrwxrwx 1 root root 16 Jan 20 20:38 /lib/systemd/system/runlevel5.target -> graphical.target

7 of 15

/lib/systemd/system/graphical.target

[Unit]�Description=Graphical Interface�Documentation=man:systemd.special(7)�Requires=multi-user.target�After=multi-user.target�Conflicts=rescue.target�Wants=display-manager.service�AllowIsolate=yes��[Install]�Alias=default.target

8 of 15

systemctl

systemctl list-units

systemctl enable foo.service

systemctl start foo.service

systemctl stop foo.service

systemctl restart foo.service

systemctl reload foo.service

systemctl status foo.service

9 of 15

journalctl

journalctl _SYSTEMD_UNIT=foo.service

journalctl -u foo

journalctl -f

10 of 15

Other commands

halt (8) - Halt, power-off or reboot the machine

hostnamectl (1) - Control the system hostname

init (1) - systemd system and service manager

journalctl (1) - Query the systemd journal

kernel-install (8) - Add and remove kernel and initramfs

images to and from...

localectl (1) - Control the system locale and keyboard

layout settings

loginctl (1) - Control the systemd login manager

poweroff (8) - Halt, power-off or reboot the machine

11 of 15

Other commands

reboot (8) - Halt, power-off or reboot the machine

runlevel (8) - Print previous and current SysV runlevel

shutdown (8) - Halt, power-off or reboot the machine

systemctl (1) - Control the systemd system and service

manager

systemd (1) - systemd system and service manager

12 of 15

Other commands

systemd-analyze (1) - Analyze system boot-up performance

systemd-ask-password (1) - Query the user for a system password

systemd-cat (1) - Connect a pipeline or program's output

with the journal

systemd-cgls (1) - Recursively show control group contents

systemd-cgtop (1) - Show top control groups by their resource

usage

systemd-coredumpctl (1) - Retrieve coredumps from the journal

systemd-delta (1) - Find overridden configuration files

systemd-detect-virt (1) - Detect execution in a virtualized

environment

13 of 15

Other commands

systemd-inhibit (1) - Execute a program with an inhibition lock

taken

systemd-machine-id-setup (1) - Initialize the machine ID in

/etc/machine-id

systemd-notify (1) - Notify service manager about start-up

completion and o...

systemd-nspawn (1) - Spawn a namespace container for

debugging, testing and...

systemd-tmpfiles (8) - Creates, deletes and cleans up volatile

and temporary ...

systemd-tty-ask-password-agent (1) - List or process pending

systemd password...

14 of 15

Other commands

telinit (8) - Change SysV runlevel

timedatectl (1) - Control the system time and date

udevadm (8) - udev management tool

15 of 15

For more information...