View on GitHub

presentations

Presentation notes from JMU Unix Users Group meetings

systemd


History


More History


systemd utilities (pt1)


systemd utilities (pt2)


Unit types


Take a look


systemd generators


systemd cgroup integration


systemd security integration


A note about targets


About parallelization


About the boot process


Find help


Starting a simple service


Let’s create a service


Service types


A very simple service

# cat /etc/systemd/system/speedtest.service
[Unit]
Description=Run openssl speed test

[Service]
ExecStart=/usr/bin/openssl speed -multi 4

[Install]
WantedBy=multi-user.target

Activate, inspect, kill


Tame that service

[Service]
Restart=no
RuntimeMaxSec=30
AllowedCPUs=0

systemd timers vs cron


systemd timers


Create a very simple timer

cat /etc/systemd/system/speedtest.timer
[Unit]
Description=Run speedtest every minute

[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true

[Install]
WantedBy=timers.target

Security bonus round

# cat /etc/systemd/system/tree.service
[Unit]
Description=Run tree

[Service]
ExecStart=/usr/bin/tree -L 2 /

[Install]
WantedBy=multi-user.target

Security fail


Minor lockdown

# cat /etc/systemd/system/tree.service
[Unit]
Description=Run tree

[Service]
ExecStart=/usr/bin/tree -L 2 /
InaccessiblePaths=/etc /var

[Install]
WantedBy=multi-user.target