Upgrade to Pro — share decks privately, control downloads, hide ads and more …

systemd / Amazon Linux 2

systemd / Amazon Linux 2

Thorsten Hoeger

February 08, 2018
Tweet

More Decks by Thorsten Hoeger

Other Decks in Programming

Transcript

  1. About me • Thorsten Höger • Cloud Evangelist - Taimos

    GmbH • AWS Community Hero • twitter: @hoegertn • web: www.taimos.de
  2. Agenda • What is systemd? • systemd vs. sysvinit •

    Basics • Anatomy of a unit file • Logging • Questions?
  3. What is systemd? • „systemd is an init system used

    in Linux distributions to bootstrap the user space and to manage system processes after booting. It is a replacement for the UNIX System V and Berkeley Software Distribution (BSD) init systems. The goal is unification of basic Linux configurations and service behaviors across all distributions. “ - Wikipedia • Lennart Poettering and Kay Sievers started the project to develop systemd in 2010 • In May 2011 Fedora became the first major Linux distribution to enable systemd by default
  4. systemd vs. sysvinit • Usage of a systemd unit file

    instead of init scripts • “run” behavior instead of “start” behavior • Logging is integrated
  5. Basics • Start a service • systemctl start some.service •

    Stop a service • systemctl stop some.service • Show service status • systemctl status some.service • Reload unit file into systemd • systemctl daemon-reload
  6. Anatomy of a unit file • Types of units •

    service • Manages a system service • socket • Activates the corresponding service when activity on a socket happens • timer • Activates the corresponding service based on a schedule (see cron)
  7. Logging • systemd grabs the logs from stdout • journald

    manages the logs • Show log for a single unit • journalctl -u some.service • Live log • journalctl -f -u some.service