Systemd

Introduction

Introduction

replaces init

systemd:

+ /usr/lib/systemd/system/ + /etc/systemd/system/

systemd init system (doesn’t have runlevels)

/lib/systemd/system/<nginx.service>

/etc/systemd/system/multi-user.target.wants/<nginx.service>

/etc/inittab not on systemd

Replacing cron with systemd

General commands

List installed

systemctl list-unit-files
systemctl status

running

systemctl list-units
systemctl daemon-reload

see if thing failed:

systemctl --failed

journalctl

see logs: journalctl (part of systemd?)

journalctl

Unit specific commands

systemctl status <unit>
systemctl help <help>
systemctl is-enabled <unit>
systemctl start <unit>
systemctl start <unit>
systemctl stop <unit>
systemctl restart <unit>
systemctl reload <unit>

Starts at boot, or starts now.

systemctl enable <unit>
systemctl enable <unit> --now
systemctl disable <unit>
systemctl reenable <unit>
systemctl mask <unit>
systemctl unmask <unit>
systemctl edit <unit>
systemctl revert <unit>

Replacing GRUB with systemd-boot

systemd-boot

Alternative to GRUB which supports UEFI.

systemd-stub

The systemd implementation of /tmp

Introduction

Mounting with systemd

Introduction

systemd-gpt-auto-generator

systemd.automount

Requires GPT.

If using systemd, don’t need to manually create swap for partition in /etc/fstab, systemd will find it by going through partitions

Doesn’t replace /etc/fstab, but means don’t need to include drives on GPT there, or swap.

systemd-cryptenroll

Introduction

Can manage physical security tokens and passwords for LUKS2.

systemd-homed

Introduction

Allows the creation of portable users.