SlideShare uma empresa Scribd logo
1 de 72
Baixar para ler offline
systemd, the next-generation Linux system manager
LISA15
Nov. 9, 2015
Alison Chaiken
alison@she-devel.com
Latest version with fixes at http://she-devel.com/LISA15/LISA15_systemd.pdf
2
Topics
● Introduction: set up test environment.
● Basic concepts and tools
● Deeper dive into units, services and targets
● Dependencies and service activation
● Security and resource controls
● Performance tuning and failure analysis
StuartChalmers
3
Key to examples
● This font is for regular explanatory text and comments.
● Blue font is for hyperlinks.
● echo “green font for code snippets”
– Some are OK on localhost, others only in container or VM!
4
Quiz!
1 What is the most-deployed Linux init system, by number of devices?
a systemd;
b sysVinit;
c upstart;
d other.
2 systemd exits shortly after userspace comes up. (T/F)
3 systemd runs as
a one giant application;
b many threads of execution;
c a collection of processes;
d a virtual machine.
5
Quiz, p. 2
1 The license of systemd is:
a GPLv2;
b GPLv3;
c permissive;
d proprietary.
2 systemd runs on Linux as well as BSD and MacOS (T/F).
3 systemd's first distro release was:
a Fedora in 2011;
b Debian in 2014;
c RHEL in 2015.
6
Basic Concepts
Philosophy of systemd
Extract duplicate functionality from daemons and move it to 
systemd core or kernel.
Replace init.d scripts with declarative config files.
Expose newer kernel APIs to userspace via a simple interface.
Control behavior of applications via unit files rather than with 
code changes.
● modular;
● asynchronous and concurrent;
● described by declarative sets of properties;
● bundled with analysis tools and tests;
● features a fully language-agnostic API.
systemd is:
One daemon to rule them all
xinetd: a daemon to lazily launch internet
services when activity is detected on an
AF_INET socket
systemd: a daemon to lazily launch any
system service when activity is detected on
an AF_UNIX socket (oversimplification)
How to RTFM Most Effectively
● Get the source:
git clone git@github.com:systemd/systemd.git
● Provides a single grep-able directory with all man pages.
● As a last resort, grep the source to find the origin of an error message.
● The catch: must upload SSH key to github to clone from there.
Setup Test
Environment
12
Exercise 0: Install a container or VM in which to
test systemd
Either:
− boot up your favorite Linux container or VM;
− or follow instructions to create a Debian or Fedora container;
− or copy the Debian or Fedora container on the shared USB
stick
− or bring a device (e.g. RPi) on which to run Linux.
Any systemd installation >= 208 should work fine:
ps -p 1; systemctl --version
13
Configure container or VM for easy testing
● Create a regular user (not root) and add to /etc/sudoers.
● Add the user to the systemd-journal group.
● If possible, install cups and nmap in the container/VM/device or
on localhost.
● If possible, install graphviz on localhost.
14
(optional) systemd-nspawn lightning course
● systemd-nspawn manages systemd's native container type
● Basically a namespaced chroot that reuses host's kernel.
● Start console session for container:
– sudo systemd-nspawn -D </path/to/container/>
● 'Boot' the container:
– sudo systemd-nspawn -bD </path/to/container>
● Monitor and control from host:
– machinectl list and machinectl status (not available in older versions)
– sudo machinectl reboot <container name>
– machinectl list-images
Preliminaries
Get started with systemctl and journalctl
● addgroup $USER systemd-journal for access.
●
systemctl status; systemctl status ssh
● journalctl -xn; journalctl -u ssh
● systemctl --failed; journalctl -p err
● sudo systemctl start cups (or restart)
● systemctl show ntp
● sudo systemctl poweroff or sudo systemctl reboot
Units and Services
Complexity arising from many similar small units
CourtesyBillWard
init.d scripts ÞÞ systemd units
● Unit's action and parameters: ExecStart=
● Dependencies: Before=, After=, Requires=, Conflicts=
and Wants=.
● Default dependencies:
– Requires= and After= on basic.target;
– Conflicts= and Before= on shutdown.target.
● Types of unit files: service, socket, device, mount,
scope, slice, automount, swap, target, path, timer,
snapshot
● See 'man systemd.unit' or freedesktop.org
Anatomy of a Unit File
● ExecStart can point to any executable, including a shell script.
● Unit files typically include a [Unit] section and a [Service] section.
● An [Install] section determines the target with which a unit is
associated.
● Try: systemctl cat ssh or systemctl show ssh
21
Precedence of unit files
● /lib/systemd/system/: upstream defaults for system-
wide services
● /etc/systemd/system/: local customizations by
override and extension
● 'drop-ins' are extension fragments akin to those in
/etc/yum.repos.d/ or /etc/apt.conf.d/.
● Try: systemd-delta
22
Exercise 1: create a HelloWorld service
1 Create HelloWorld.service in your container that prints “Hello
World” into the systemd journal.
2 Situate it in the filesystem where systemd can find it.
3 Start the service using systemctl.
4 Check the status of your service. Where has “Hello, world”
output appeared?
23
Solution: simple HelloWorld.service
1 With a text editor, create helloworld.sh:
#!/bin/bash
echo “Hello World!”
2 Copy the script into your container's filesystem:
chmod +x helloworld.sh
cp helloworld.sh /var/lib/machines/debian/usr/local/bin/
3 With a text editor, create HelloWorld.service:
[Unit]
Description=Hello World Service
Documentation=
[Service]
ExecStart=/usr/local/bin/helloworld.sh
4 Copy the unit file into the container's filesystem:
cp HelloWorld.service /var/lib/machines/debian/etc/systemd/system/
(or, on your localhost, cp HelloWorld.service /etc/systemd/system/)
5 Boot the container, then load and run the unit:
sudo systemd-nspawn -bD /var/lib/machines/debian
[inside container] sudo systemctl start HelloWorld
[inside container] systemctl status HelloWorld
[inside container]journalctl -u HelloWorld
Targets
vs.
Runlevels
sysVinit runlevels ≈ systemd targets
● Targets are synchronization points.
● Check /lib/systemd/system/runlevel?.target symlinks:
multi-user.target (runlevel 3 == text session)
graphical.target (runlevel 5 == graphical session)
● Select boot-target :
– via /etc/systemd/system/default.target symlink;
– by appending systemd.unit=<target> to bootargs.
● Helpful diagram: “man 7 bootup”
Target Basics
● Service S will be started as part of Target T iff S.service file is symlinked in the
directory /etc/systemd/system/T.wants.
● If S's unit file contains WantedBy=T, then
systemctl enable S
will create a symlink to S.service in /etc/systemd/system/T.wants
● Similarly
systemctl disable S
removes the symlink.
● To blacklist a service
systemctl mask S.service
● 'rm' or 'ln' can manage the services: there is no binary 'registry' DB.
Exercise 2: Make HelloWorld.service run at Boot
● Modify HelloWorld.service.
● Enable it.
● Reboot and verify that the service is now started.
● Disable the service, reboot and verify that service is not
started.
Solution: make HelloWorld.Service run at boot
● Append a “WantedBy” line to a new [Install] section in the unit:
[Install]
WantedBy=multi-user.target
● Boot container and enable the unit:
sudo systemd-nspawn -bD /var/lib/machines/debian
[inside container] sudo systemctl enable HelloWorld
[inside container] ls /etc/systemd/system/multi-user.target.wants
● Reboot and check status:
[inside container] sudo systemctl reboot
[inside container] systemctl status HelloWorld
● Disable the service, reboot and check again:
[inside container] sudo systemctl disable HelloWorld [fails if the file is cp'ed, not ln'ed]
[inside container] sudo systemctl reboot
[inside container] systemctl status HelloWorld
systemd's dependencies
Demo: Generate ASCII Dependency Graphs
Examples:
systemctl list-dependencies basic.target
systemctl list-dependencies --after cups.socket
systemctl list-dependencies --before multi-user.target
Generate dependency metadata:
systemd-analyze dot basic.target > basic.dot
Generate graph image:
dot -Tsvg basic.dot -o basic.svg
View graph:
eog basic.svg (or view basic.svg with any web browser)
Note: dot is in graphviz package; eog is in eponymous one.
Generate SVG Dependency Graph
systemd bootup is ordered, but not deterministic
● Services start other services they 'Want' or 'Require'.
● Services stop if other services they 'Require' stop, but not if
services they 'Want' stop.
● 'After' means 'start after another service starts'.
– Not 'start after another service is fully initialized' or finished.
– 'Before' is similar.
● To express more nuanced sequence, use Path, PID or Socket-
based signalling. Examples:
– ConditionPathExists= in unit file listing /var/run/*.pid
– systemd-notify messages to socket
FAQ
33
Simple targets
vs.
runlevels
Not all targets are 'runlevels'
● Targets can simply be collections of services all started at once.
● A runlevel is a special target that is reached only when all
wanted services reach completion.
● RTFM: man systemd.special
● New simple targets = new unit files + directories with symlinks.
● New runlevels require new code.
courtesyPierre-YvesBeaudoin
FAQ
FAQ: how do I create a new runlevel?
● You don't want to.
– Doing so involves writing a bunch of C/C++ code.
● Creating a new runlevel is possible.
– GENIVI automotive Linux project has done it.
– Code is available from
git://git.projects.genivi.org/lifecycle/node-startup-controller.git
– Webcast slides and audio
– Use case: a LAN with many dumb no-OS MCUs.
● Is your use case truly so different from those considered by
freedesktop.org?
From GENIVI Lifecycle Management webcast slides; the source code
37
Unit file hierarchy
and precedence
38
system and user system instances
● systemd's system instance manages singleton daemons that
provide systemwide services;
● systemd's user instance manages per-user services.
● Try:
– systemctl --user status
● Discuss: why does systemctl --user status fail?
● Configuration files are in $HOME, not /etc/systemd.
● User instance only runs if systemd is built with PAM feature:
systemctl --version | grep PAM
39
system and user units
● Organized into system and user units.
● /lib/systemd/system: systemd upstream's defaults for
system-wide services
● /usr/lib/systemd/user/: systemd upstream's defaults for
per-user services
● $HOME/.local/share/systemd/user/ for user-installed
units
● 'drop-ins' are run-time extensions (man systemd.unit) for
either user or system instances.
40
Precedence of system unit files
Tip: create unit files for new services in /etc. Drop-ins are for override.
lowest;
from upstream
optional;
static
optional;
dynamically generated
alternatives that
produce the same result
highest; optional;
static
in /etc/systemd/system/<unit-name>.d/foo.conf
in /etc/systemd/system/foo.service
in /run/systemd/system/foo.service
in /lib/systemd/system/foo.service
man systemd.unit
41
Exercise 3:Understanding unit file hierarchy
● Display path and text of currently loaded unit file.
systemctl cat systemd-logind
● Copy the currently loaded unit to a position higher in
the unit-file hierarchy.
sudo cp /lib/systemd/system/systemd-logind.service /etc/systemd/system
● Try: systemctl cat systemd-logind
– Is the result what you expected? Why?
● Another clue:
systemd-delta
42
Unit file hierarchy puzzle: the answer
● sudo systemctl daemon-reload
● systemctl cat systemd-logind
● Clean-up. (Why is this important?)
– sudo rm /etc/systemd/system/systemd-logind.service
● And repeat sudo systemctl daemon-reload
FAQ
Understanding socket-based
activation
and Upstart
Serial Linked list Fully parallel
Socket-based activation is key to systemd's fast boot
Demo:control cups via socket-based activation
● Check if cups is running and stop it:
systemctl status cups.service
sudo systemctl stop cups.service
systemctl status cups.service
● What is cups.socket?
systemctl cat cups.socket
systemctl status cups.socket
● What is the difference between /lib/systemd/system/cups.socket
and /var/run/cups/cups.sock?
● cups.sock is a normal AF_UNIX socket, so
echo “HTTP POST” | ncat -U /var/run/cups/cups.socket
● Now check cups.service:
systemctl status cups.service
Tune and control
your configuration
with systemd
systemd intuitively exposes kernel interfaces
● Including Capabilities, Watchdog, Cgroups and kdbus
('coming attraction')
● Kernel features are configurable via systemd's unit files.
● Encourages creation of system-wide policies via unit
templates.
● man 7 capabilities
systemd and cgroups
● cgroups were difficult to config prior to advent of systemd tools.
● cgroups are a kernel-level mechanism for allocating resources:
storage, memory, CPU and network.
● slices are groups of services whose resources are managed
jointly.
● systemd scopes are resultant groups of processes.
● Sysadmins can set BlockIOWeight, IOSchedulingPriority,
OOMScoreAdjust, CPUShares, MemoryLimit, Nice …
● Reference: kernel's documentation and 'man systemd.resource-
control'
From GENIVI Lifecycle Management webcast slides (GENIVI automotive Linux consortium)
check cgroup configuration on your current system
● systemd-cgls
● systemd-cgtop
● mount | grep cgroup shows which 'controllers' are available
● NOTE:
Which controllers are available depends on the kernel config:
grep CGROUP /boot/config*
● NOTE:
unless "CPUAccounting=1", "MemoryAccounting=1" and
"BlockIOAccounting=1" are enabled for the services in question, no
resource accounting will be available for system services and the data
shown by systemd-cgtop will be incomplete.
Exercise 4: set 'niceness' of Firefox
● Create a service that starts Firefox with per-user settings in firefox.slice.
● Set the 'niceness' of Firefox.
● Check that the process runs at the 'niceness' you've set.
● Hints:
– You may need to run 'xhost +localhost' on localhost.
– Possibly add 'Environment=DISPLAY=:0' to your unit file.
– man systemd.exec
Solution: nice Firefox
● Create a firefox.service file in /usr/lib/systemd/user:
[Unit]
Description=Firefox web browser
[Service]
Environment=DISPLAY=:0
ExecStart=/usr/bin/firefox (might be /bin/firefox)
Nice=12
Slice=firefox.slice (optional but worth trying to see its effect)
● systemctl --user start firefox
● systemd-cgls
● Employ ps or top to check 'niceness'.
● Note that you now need
systemctl --user enable firefox
systemctl --user daemon-reload
journalctl –user-unit=firefox (not journalctl --user though)
systemd and security:
granular encapsulationvia kernel's capabilities
● CapabilityBoundingSet at boot; capability dropping possible
● PrivateTmp, PrivateDevices, PrivateNetwork, JoinNamespaces
● ProtectSystem (/usr and /etc), ProtectHome
● ReadOnlyDirectories, InaccessibleDirectories
● Set system-wide security policies via /etc/systemd/*conf files
● References: LWN on “Inheriting capabilities” and man
capabilities
Exercise 6: control file access of firefox.service
● Add 'CapabilityBoundingSet=' to firefox.service and restart.
– Investigate with getpcaps, journalctl and systemctl. (getpcaps
may not be in your default $PATH.)
● Replace CapabilityBoundingSet directive with
'InaccessibleDirectories=/home'.
● Move to /etc/systemd/system and restart.
– Try to read files in /home with the browser after starting it from
'sudo -i'.
– Explain the behavior.
● Don't forget 'systemctl daemon-reload' and '--user'.
Solution: limiting Firefox's access
● Starting firefox.service as jack, from /etc/systemd/user, with
CapabilityBoundingSet=
[jack@f22container ~]$ systemctl --user daemon-reload
[jack@f22container ~]$ systemctl --user start firefox
[jack@f22container ~]$ systemctl --user --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● firefox.service loaded failed failed Firefox web browser
[jack@f22container ~]$ journalctl --user -p err
Sep 19 16:44:03 f22container systemd[300]: Failed at step
CAPABILITIES spawning /bin/firefox: Operation not permitted
Solution: limiting Firefox's access
● Starting firefox.service with sudo from /etc/systemd/system, without
'CapabilityBoundingSet=',
bash-4.3# getpcaps `pidof firefox`
Capabilities for `1923': =
cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,ca
p_setuid,cap_setpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_ra
w,cap_ipc_owner,cap_sys_chroot,cap_sys_ptrace,cap_sys_admin,cap_sys_boot,cap_sys_nice,ca
p_sys_resource,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap
_setfcap+ep
● With 'CapabilityBoundingSet=',
bash-4.3# systemctl daemon-reload
bash-4.3# getpcaps `pidof firefox`
Capabilities for `2036': =
● A bit simpler than SELinux!
Solution: limit Firefox's access
● Starting firefox.service as root from /etc/systemd/system and
without 'InaccessibleDirectories=/home',
● Starting firefox.service as root from /etc/systemd/system and
with 'InaccessibleDirectories=/home',
systemd troubleshooting
ProTips!
When all else fails, consult the files in /etc/systemd/*.conf.
Dump all potential configuration items:
/lib/systemd/systemd --dump-configuration-items
Most useful man pages:
man systemd.exec
man systemd.unit
man systemd.service
Consult systemd mailing list archives and wiki.
A bit more about the systemd journal
● In binary format, but has a simple UI that beats 'grep' and 'awk'.
● Is fully compatible with parallel syslog output.
● Can push the journal to a remote via unit file configuration.
● Can be automatically cryptographically signed.
● Is, with udev, one of the required systemd components.
● Test out new units by trying them:
– systemd-analyze verify <new unit>
– in /run
– in *.conf.d directory
– via bootargs
● Do not ever modify files in /lib/systemd.
– Restore defaults by removing broken units with higher
precedence.
● Services linked into basic.target.wants (≈runlevel 1) that won't
work until graphical.target (runlevel 5) will start properly if their
dependencies are correctly stated.
systemd prevents self-injury!
systemd's watchdog timer support
●
Provides simple configuration of soft or hard watchdogs.
●
RuntimeWatchdogSec sets a timer for petting the dog.
●
ShutdownWatchdogSec sets a timer to force reboot if
shutdown hangs.
62
'systemd-analyze critical-chain':
Why did that unit take so long to start?
Note: ntp was started by SysVinit!!
Final quiz
● T/F: systemd is best characterized as an init system.
● Which of the following is not a recommended way to customize systemd?
a Edit /etc/systemd/*.conf files;
b Edit the files in /lib/systemd/system;
c Edit /etc/systemd/<unit-name.d>/*.conf files;
d Employ “systemctl enable” and “systemctl disable”.
● Which of the following is not a real systemd component?
systemd-nspawn, systemd-logind, packagectl, systemd-delta
● Which of the following is true? The systemd journal:
a is incompatible with syslog;
b can be viewed with systemd-journalviewer or a browser;
c can be cryptographically signed automatically;
d is configured via an XML file.
● T/F: systemd services are always started via socket-based activation.
Summary
● systemd is easier to configure and customize than you fear.
● Most users will not notice (or have not noticed).
● There are real difficulties but
– systemd is still relatively new;
– system administration is complex.
Additional Resources
● Man pages are part of systemd git repo.
● freedesktop.org: systemd mailing list archives and wiki; Pöttering's blog
● #systemd on Freenode IRC
● ➟At wayback machine: “Booting up” articles
● systemd.conf YouTube channel and slides
● Neil Brown series at LWN on 'systemd programming' (design of NFS units)
● ➟Fedora's SysVinit to systemd cheatsheet
● LWN on “How Debian managed the systemd transition ”
● Linux Action Show interview with Lennart Poettering
● “Who wrote systemd?” statistics
● Jordan Hubbard of FreeBSD describes launchd porting plans (at 40 mins.)
Acknowledgements
https://commons.wikimedia.org/wiki/File:Pronam-mudra.png#/media/File:Pronam-mudra.png
• twb and ohsix on #systemd on freenode IRC
• Zbigniew Jędrzejewski-Szmek on systemd-devel
• Kevin Dankwardt for help with organizing class
• USENIX/LISA for invitation.
Course evaluation
● The course was too introductory/too advanced.
● The amount of lecture versus exercises was too
high/too low.
● The course content is relevant to my work: T/F.
● I now understand systemd better: T/F.
● I know how to find more information about systemd:
T/F.
Email to alison@she-devel.com
69
system and user units derive from D-Bus
● systemd cooperates with D-Bus to provide:
– singleton daemons that provide systemwide services;
– per-user services.
● Try:
– busctl --system | head
– busctl --user | head
● Same information is accessible via qdbus or gdbus.
● Reference: “Control your Linux desktop with D-Bus”
Exercise: control firefox's memory utilization
● The following works on systems where localhost's kernel is compiled with CONFIG_MEMCG=y.
– Don't forget that containers share the kernel with localhost.
● Create a unit file that will start firefox.
● Turn on memory accounting.
● Check firefox's memory accounting via systemd-cgtop.
● Add a MemoryLimit field to the unit file.
● Restart your service and check the memory utilization again: top or ps -o slice,vsize,rss,%mem -C firefox.
● Hints: you may need to run 'xhost +localhost' on localhost and add
'Environment=DISPLAY=:0' to your unit file.
Firefox and cgroups solution
● firefox.service:
[Unit]
Description=Firefox web browser
[Service]
Environment=DISPLAY=:0
ExecStart=/usr/bin/firefox (or /bin/firefox)
MemoryAccounting=true
MemoryLimit=10M
● sudo mv firefox.service /etc/systemd/user
● systemctl --user start firefox
● systemd-cgtop and ps -o slice,vsize,rss,%mem -C firefox
● Remove MemoryLimit and compare.
Taxonomy of systemd tools
● Analogous to 'git'.
● 'Porcelain' generalized tools: 'ls /bin/*ctl'
– journalctl, systemctl, machinectl, busctl, loginctl, networkctl
– Man pages, useful in bash scripts.
● 'Plumbing' components: 'find /lib/systemd -executable -type f'
– A few lack man pages; try '--help'.
– Tools that are invoked by other tools.
– May be useful in testing.
● Domain-specific: 'ls /usr/bin/systemd-*'
"20060513 toolbox" by Per Erik Strandberg sv:User:PER9000 - Own work.
Licensed under CC BY-SA 2.5 via Commons -
https://commons.wikimedia.org/wiki/File:20060513_toolbox.jpg#/media/File:20060513_toolbox.jpg

Mais conteúdo relacionado

Mais procurados

Effective service and resource management with systemd
Effective service and resource management with systemdEffective service and resource management with systemd
Effective service and resource management with systemdDavid Timothy Strauss
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawnGábor Nyers
 
Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12Gábor Nyers
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemdYusaku OGAWA
 
Kernel Recipes 2015 - So you want to write a Linux driver framework
Kernel Recipes 2015 - So you want to write a Linux driver frameworkKernel Recipes 2015 - So you want to write a Linux driver framework
Kernel Recipes 2015 - So you want to write a Linux driver frameworkAnne Nicolas
 
Windows Internals for Linux Kernel Developers
Windows Internals for Linux Kernel DevelopersWindows Internals for Linux Kernel Developers
Windows Internals for Linux Kernel DevelopersKernel TLV
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisAnne Nicolas
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersKernel TLV
 
Linux Containers From Scratch
Linux Containers From ScratchLinux Containers From Scratch
Linux Containers From Scratchjoshuasoundcloud
 
Advanced Namespaces and cgroups
Advanced Namespaces and cgroupsAdvanced Namespaces and cgroups
Advanced Namespaces and cgroupsKernel TLV
 
Linux cgroups and namespaces
Linux cgroups and namespacesLinux cgroups and namespaces
Linux cgroups and namespacesLocaweb
 
Kernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneKernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneAnne Nicolas
 
Kernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologiesKernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologiesAnne Nicolas
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelOpenVZ
 
Kernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architectureKernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architectureAnne Nicolas
 
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPFUSENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPFBrendan Gregg
 

Mais procurados (20)

Effective service and resource management with systemd
Effective service and resource management with systemdEffective service and resource management with systemd
Effective service and resource management with systemd
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 
Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12Full system roll-back and systemd in SUSE Linux Enterprise 12
Full system roll-back and systemd in SUSE Linux Enterprise 12
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemd
 
Basic of Systemd
Basic of SystemdBasic of Systemd
Basic of Systemd
 
Systemd poettering
Systemd poetteringSystemd poettering
Systemd poettering
 
Kernel Recipes 2015 - So you want to write a Linux driver framework
Kernel Recipes 2015 - So you want to write a Linux driver frameworkKernel Recipes 2015 - So you want to write a Linux driver framework
Kernel Recipes 2015 - So you want to write a Linux driver framework
 
Windows Internals for Linux Kernel Developers
Windows Internals for Linux Kernel DevelopersWindows Internals for Linux Kernel Developers
Windows Internals for Linux Kernel Developers
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysis
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containers
 
Linux Containers From Scratch
Linux Containers From ScratchLinux Containers From Scratch
Linux Containers From Scratch
 
Advanced Namespaces and cgroups
Advanced Namespaces and cgroupsAdvanced Namespaces and cgroups
Advanced Namespaces and cgroups
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Linux cgroups and namespaces
Linux cgroups and namespacesLinux cgroups and namespaces
Linux cgroups and namespaces
 
Kernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyoneKernel Recipes 2015 - Hardened kernels for everyone
Kernel Recipes 2015 - Hardened kernels for everyone
 
Kernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologiesKernel Recipes 2015: Kernel packet capture technologies
Kernel Recipes 2015: Kernel packet capture technologies
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux Kernel
 
Kernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architectureKernel Recipes 2015 - Porting Linux to a new processor architecture
Kernel Recipes 2015 - Porting Linux to a new processor architecture
 
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPFUSENIX ATC 2017 Performance Superpowers with Enhanced BPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
 

Destaque

Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems Baruch Osoveskiy
 
Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...
Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...
Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...Principled Technologies
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCoburn Watson
 
Boost UDP Transaction Performance
Boost UDP Transaction PerformanceBoost UDP Transaction Performance
Boost UDP Transaction PerformanceLF Events
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringGeorg Schönberger
 
Improving Hadoop Performance via Linux
Improving Hadoop Performance via LinuxImproving Hadoop Performance via Linux
Improving Hadoop Performance via LinuxAlex Moundalexis
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and DockerFabio Fumarola
 
Improving Hadoop Cluster Performance via Linux Configuration
Improving Hadoop Cluster Performance via Linux ConfigurationImproving Hadoop Cluster Performance via Linux Configuration
Improving Hadoop Cluster Performance via Linux ConfigurationAlex Moundalexis
 
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cFrank Munz
 
NVMe Over Fabrics Support in Linux
NVMe Over Fabrics Support in LinuxNVMe Over Fabrics Support in Linux
NVMe Over Fabrics Support in LinuxLF Events
 
SR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementSR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementLF Events
 
WebLogic im Docker Container
WebLogic im Docker ContainerWebLogic im Docker Container
WebLogic im Docker ContainerAndreas Koop
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017Arun Gupta
 
Advanced troubleshooting linux performance
Advanced troubleshooting linux performanceAdvanced troubleshooting linux performance
Advanced troubleshooting linux performanceForthscale
 
Feature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionFeature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionLF Events
 
Container Storage Best Practices in 2017
Container Storage Best Practices in 2017Container Storage Best Practices in 2017
Container Storage Best Practices in 2017Keith Resar
 
Container World 2017!
Container World 2017!Container World 2017!
Container World 2017!kgraham32
 
Oracle: Building Cloud Native Applications
Oracle: Building Cloud Native ApplicationsOracle: Building Cloud Native Applications
Oracle: Building Cloud Native ApplicationsKelly Goetsch
 

Destaque (20)

Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems
 
Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...
Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...
Comparing file system performance: Red Hat Enterprise Linux 6 vs. Microsoft W...
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performance
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Boost UDP Transaction Performance
Boost UDP Transaction PerformanceBoost UDP Transaction Performance
Boost UDP Transaction Performance
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
 
Improving Hadoop Performance via Linux
Improving Hadoop Performance via LinuxImproving Hadoop Performance via Linux
Improving Hadoop Performance via Linux
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
 
Improving Hadoop Cluster Performance via Linux Configuration
Improving Hadoop Cluster Performance via Linux ConfigurationImproving Hadoop Cluster Performance via Linux Configuration
Improving Hadoop Cluster Performance via Linux Configuration
 
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
 
NVMe Over Fabrics Support in Linux
NVMe Over Fabrics Support in LinuxNVMe Over Fabrics Support in Linux
NVMe Over Fabrics Support in Linux
 
SR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementSR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and Improvement
 
WebLogic im Docker Container
WebLogic im Docker ContainerWebLogic im Docker Container
WebLogic im Docker Container
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017
 
Advanced troubleshooting linux performance
Advanced troubleshooting linux performanceAdvanced troubleshooting linux performance
Advanced troubleshooting linux performance
 
Feature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionFeature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with Encryption
 
Container Storage Best Practices in 2017
Container Storage Best Practices in 2017Container Storage Best Practices in 2017
Container Storage Best Practices in 2017
 
Container World 2017!
Container World 2017!Container World 2017!
Container World 2017!
 
Function Point Analysis
Function Point AnalysisFunction Point Analysis
Function Point Analysis
 
Oracle: Building Cloud Native Applications
Oracle: Building Cloud Native ApplicationsOracle: Building Cloud Native Applications
Oracle: Building Cloud Native Applications
 

Semelhante a LISA15: systemd, the Next-Generation Linux System Manager

Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesPuppet
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakNETWAYS
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment Systema3sec
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevelsJohn Ombagi
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Gerard Braad
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhereNew Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhereRodrique Heron
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to AnsibleCédric Delgehier
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1Susant Sahani
 
101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and rebootAcácio Oliveira
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Amin Astaneh
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil FrameworkVeilFramework
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemdAlison Chaiken
 
Systemd evolution revolution_regression
Systemd evolution revolution_regressionSystemd evolution revolution_regression
Systemd evolution revolution_regressionSusant Sahani
 

Semelhante a LISA15: systemd, the Next-Generation Linux System Manager (20)

Pdf c1t tlawaxb
Pdf c1t tlawaxbPdf c1t tlawaxb
Pdf c1t tlawaxb
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhereNew Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
 
systemd
systemdsystemd
systemd
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
 
101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemd
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Systemd evolution revolution_regression
Systemd evolution revolution_regressionSystemd evolution revolution_regression
Systemd evolution revolution_regression
 

Mais de Alison Chaiken

Not breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABINot breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABIAlison Chaiken
 
Supporting SW Update via u-boot and GPT/EFI
Supporting SW Update via u-boot and GPT/EFISupporting SW Update via u-boot and GPT/EFI
Supporting SW Update via u-boot and GPT/EFIAlison Chaiken
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsAlison Chaiken
 
V2X Communications: Getting our Cars Talking
V2X Communications: Getting our Cars TalkingV2X Communications: Getting our Cars Talking
V2X Communications: Getting our Cars TalkingAlison Chaiken
 
Practical Challenges to Deploying Highly Automated Vehicles
Practical Challenges to Deploying Highly Automated VehiclesPractical Challenges to Deploying Highly Automated Vehicles
Practical Challenges to Deploying Highly Automated VehiclesAlison Chaiken
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first secondAlison Chaiken
 
Functional AI and Pervasive Networking in Automotive
 Functional AI and Pervasive Networking in Automotive Functional AI and Pervasive Networking in Automotive
Functional AI and Pervasive Networking in AutomotiveAlison Chaiken
 
Flash in Vehicles: an End-User's Perspective
Flash in Vehicles: an End-User's PerspectiveFlash in Vehicles: an End-User's Perspective
Flash in Vehicles: an End-User's PerspectiveAlison Chaiken
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first secondAlison Chaiken
 
Automotive Linux, Cybersecurity and Transparency
Automotive Linux, Cybersecurity and TransparencyAutomotive Linux, Cybersecurity and Transparency
Automotive Linux, Cybersecurity and TransparencyAlison Chaiken
 
Developing Automotive Linux
Developing Automotive LinuxDeveloping Automotive Linux
Developing Automotive LinuxAlison Chaiken
 
Technology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected CarTechnology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected CarAlison Chaiken
 
Best practices for long-term support and security of the device-tree
Best practices for long-term support and security of the device-treeBest practices for long-term support and security of the device-tree
Best practices for long-term support and security of the device-treeAlison Chaiken
 
The “Telematics Horizon” V2V and V2I Networking
The “Telematics Horizon” V2V and V2I NetworkingThe “Telematics Horizon” V2V and V2I Networking
The “Telematics Horizon” V2V and V2I NetworkingAlison Chaiken
 
Developing automotive Linux
Developing automotive LinuxDeveloping automotive Linux
Developing automotive LinuxAlison Chaiken
 
Automotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and PrivacyAutomotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and PrivacyAlison Chaiken
 
Addressing the hard problems of automotive Linux: networking and IPC
Addressing the hard problems of automotive Linux: networking and IPCAddressing the hard problems of automotive Linux: networking and IPC
Addressing the hard problems of automotive Linux: networking and IPCAlison Chaiken
 
Tier X and the Coming of the Whitebox Car
Tier X and the Coming of the Whitebox CarTier X and the Coming of the Whitebox Car
Tier X and the Coming of the Whitebox CarAlison Chaiken
 
Booth content from Maker Faire Bay Area 2012
Booth content from Maker Faire Bay Area 2012Booth content from Maker Faire Bay Area 2012
Booth content from Maker Faire Bay Area 2012Alison Chaiken
 
From Driver Distraction to Driver Augmentation: Open Source in Cars
From Driver Distraction to Driver Augmentation: Open Source in CarsFrom Driver Distraction to Driver Augmentation: Open Source in Cars
From Driver Distraction to Driver Augmentation: Open Source in CarsAlison Chaiken
 

Mais de Alison Chaiken (20)

Not breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABINot breaking userspace: the evolving Linux ABI
Not breaking userspace: the evolving Linux ABI
 
Supporting SW Update via u-boot and GPT/EFI
Supporting SW Update via u-boot and GPT/EFISupporting SW Update via u-boot and GPT/EFI
Supporting SW Update via u-boot and GPT/EFI
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp Insights
 
V2X Communications: Getting our Cars Talking
V2X Communications: Getting our Cars TalkingV2X Communications: Getting our Cars Talking
V2X Communications: Getting our Cars Talking
 
Practical Challenges to Deploying Highly Automated Vehicles
Practical Challenges to Deploying Highly Automated VehiclesPractical Challenges to Deploying Highly Automated Vehicles
Practical Challenges to Deploying Highly Automated Vehicles
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 
Functional AI and Pervasive Networking in Automotive
 Functional AI and Pervasive Networking in Automotive Functional AI and Pervasive Networking in Automotive
Functional AI and Pervasive Networking in Automotive
 
Flash in Vehicles: an End-User's Perspective
Flash in Vehicles: an End-User's PerspectiveFlash in Vehicles: an End-User's Perspective
Flash in Vehicles: an End-User's Perspective
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 
Automotive Linux, Cybersecurity and Transparency
Automotive Linux, Cybersecurity and TransparencyAutomotive Linux, Cybersecurity and Transparency
Automotive Linux, Cybersecurity and Transparency
 
Developing Automotive Linux
Developing Automotive LinuxDeveloping Automotive Linux
Developing Automotive Linux
 
Technology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected CarTechnology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected Car
 
Best practices for long-term support and security of the device-tree
Best practices for long-term support and security of the device-treeBest practices for long-term support and security of the device-tree
Best practices for long-term support and security of the device-tree
 
The “Telematics Horizon” V2V and V2I Networking
The “Telematics Horizon” V2V and V2I NetworkingThe “Telematics Horizon” V2V and V2I Networking
The “Telematics Horizon” V2V and V2I Networking
 
Developing automotive Linux
Developing automotive LinuxDeveloping automotive Linux
Developing automotive Linux
 
Automotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and PrivacyAutomotive Free Software 2013: "Right to Repair" and Privacy
Automotive Free Software 2013: "Right to Repair" and Privacy
 
Addressing the hard problems of automotive Linux: networking and IPC
Addressing the hard problems of automotive Linux: networking and IPCAddressing the hard problems of automotive Linux: networking and IPC
Addressing the hard problems of automotive Linux: networking and IPC
 
Tier X and the Coming of the Whitebox Car
Tier X and the Coming of the Whitebox CarTier X and the Coming of the Whitebox Car
Tier X and the Coming of the Whitebox Car
 
Booth content from Maker Faire Bay Area 2012
Booth content from Maker Faire Bay Area 2012Booth content from Maker Faire Bay Area 2012
Booth content from Maker Faire Bay Area 2012
 
From Driver Distraction to Driver Augmentation: Open Source in Cars
From Driver Distraction to Driver Augmentation: Open Source in CarsFrom Driver Distraction to Driver Augmentation: Open Source in Cars
From Driver Distraction to Driver Augmentation: Open Source in Cars
 

Último

March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...gerogepatton
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosVictor Morales
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 
tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdfchess188chess188
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...arifengg7
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organizationchnrketan
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studydhruvamdhruvil123
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
Substation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHSubstation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHbirinder2
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunicationnovrain7111
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 

Último (20)

March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 
tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdf
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
ASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductosASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductos
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organization
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain study
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
Substation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHSubstation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRH
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunication
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 

LISA15: systemd, the Next-Generation Linux System Manager

  • 1. systemd, the next-generation Linux system manager LISA15 Nov. 9, 2015 Alison Chaiken alison@she-devel.com Latest version with fixes at http://she-devel.com/LISA15/LISA15_systemd.pdf
  • 2. 2 Topics ● Introduction: set up test environment. ● Basic concepts and tools ● Deeper dive into units, services and targets ● Dependencies and service activation ● Security and resource controls ● Performance tuning and failure analysis StuartChalmers
  • 3. 3 Key to examples ● This font is for regular explanatory text and comments. ● Blue font is for hyperlinks. ● echo “green font for code snippets” – Some are OK on localhost, others only in container or VM!
  • 4. 4 Quiz! 1 What is the most-deployed Linux init system, by number of devices? a systemd; b sysVinit; c upstart; d other. 2 systemd exits shortly after userspace comes up. (T/F) 3 systemd runs as a one giant application; b many threads of execution; c a collection of processes; d a virtual machine.
  • 5. 5 Quiz, p. 2 1 The license of systemd is: a GPLv2; b GPLv3; c permissive; d proprietary. 2 systemd runs on Linux as well as BSD and MacOS (T/F). 3 systemd's first distro release was: a Fedora in 2011; b Debian in 2014; c RHEL in 2015.
  • 8. ● modular; ● asynchronous and concurrent; ● described by declarative sets of properties; ● bundled with analysis tools and tests; ● features a fully language-agnostic API. systemd is:
  • 9. One daemon to rule them all xinetd: a daemon to lazily launch internet services when activity is detected on an AF_INET socket systemd: a daemon to lazily launch any system service when activity is detected on an AF_UNIX socket (oversimplification)
  • 10. How to RTFM Most Effectively ● Get the source: git clone git@github.com:systemd/systemd.git ● Provides a single grep-able directory with all man pages. ● As a last resort, grep the source to find the origin of an error message. ● The catch: must upload SSH key to github to clone from there.
  • 12. 12 Exercise 0: Install a container or VM in which to test systemd Either: − boot up your favorite Linux container or VM; − or follow instructions to create a Debian or Fedora container; − or copy the Debian or Fedora container on the shared USB stick − or bring a device (e.g. RPi) on which to run Linux. Any systemd installation >= 208 should work fine: ps -p 1; systemctl --version
  • 13. 13 Configure container or VM for easy testing ● Create a regular user (not root) and add to /etc/sudoers. ● Add the user to the systemd-journal group. ● If possible, install cups and nmap in the container/VM/device or on localhost. ● If possible, install graphviz on localhost.
  • 14. 14 (optional) systemd-nspawn lightning course ● systemd-nspawn manages systemd's native container type ● Basically a namespaced chroot that reuses host's kernel. ● Start console session for container: – sudo systemd-nspawn -D </path/to/container/> ● 'Boot' the container: – sudo systemd-nspawn -bD </path/to/container> ● Monitor and control from host: – machinectl list and machinectl status (not available in older versions) – sudo machinectl reboot <container name> – machinectl list-images
  • 16. Get started with systemctl and journalctl ● addgroup $USER systemd-journal for access. ● systemctl status; systemctl status ssh ● journalctl -xn; journalctl -u ssh ● systemctl --failed; journalctl -p err ● sudo systemctl start cups (or restart) ● systemctl show ntp ● sudo systemctl poweroff or sudo systemctl reboot
  • 18. Complexity arising from many similar small units CourtesyBillWard
  • 19. init.d scripts ÞÞ systemd units ● Unit's action and parameters: ExecStart= ● Dependencies: Before=, After=, Requires=, Conflicts= and Wants=. ● Default dependencies: – Requires= and After= on basic.target; – Conflicts= and Before= on shutdown.target. ● Types of unit files: service, socket, device, mount, scope, slice, automount, swap, target, path, timer, snapshot ● See 'man systemd.unit' or freedesktop.org
  • 20. Anatomy of a Unit File ● ExecStart can point to any executable, including a shell script. ● Unit files typically include a [Unit] section and a [Service] section. ● An [Install] section determines the target with which a unit is associated. ● Try: systemctl cat ssh or systemctl show ssh
  • 21. 21 Precedence of unit files ● /lib/systemd/system/: upstream defaults for system- wide services ● /etc/systemd/system/: local customizations by override and extension ● 'drop-ins' are extension fragments akin to those in /etc/yum.repos.d/ or /etc/apt.conf.d/. ● Try: systemd-delta
  • 22. 22 Exercise 1: create a HelloWorld service 1 Create HelloWorld.service in your container that prints “Hello World” into the systemd journal. 2 Situate it in the filesystem where systemd can find it. 3 Start the service using systemctl. 4 Check the status of your service. Where has “Hello, world” output appeared?
  • 23. 23 Solution: simple HelloWorld.service 1 With a text editor, create helloworld.sh: #!/bin/bash echo “Hello World!” 2 Copy the script into your container's filesystem: chmod +x helloworld.sh cp helloworld.sh /var/lib/machines/debian/usr/local/bin/ 3 With a text editor, create HelloWorld.service: [Unit] Description=Hello World Service Documentation= [Service] ExecStart=/usr/local/bin/helloworld.sh 4 Copy the unit file into the container's filesystem: cp HelloWorld.service /var/lib/machines/debian/etc/systemd/system/ (or, on your localhost, cp HelloWorld.service /etc/systemd/system/) 5 Boot the container, then load and run the unit: sudo systemd-nspawn -bD /var/lib/machines/debian [inside container] sudo systemctl start HelloWorld [inside container] systemctl status HelloWorld [inside container]journalctl -u HelloWorld
  • 25. sysVinit runlevels ≈ systemd targets ● Targets are synchronization points. ● Check /lib/systemd/system/runlevel?.target symlinks: multi-user.target (runlevel 3 == text session) graphical.target (runlevel 5 == graphical session) ● Select boot-target : – via /etc/systemd/system/default.target symlink; – by appending systemd.unit=<target> to bootargs. ● Helpful diagram: “man 7 bootup”
  • 26. Target Basics ● Service S will be started as part of Target T iff S.service file is symlinked in the directory /etc/systemd/system/T.wants. ● If S's unit file contains WantedBy=T, then systemctl enable S will create a symlink to S.service in /etc/systemd/system/T.wants ● Similarly systemctl disable S removes the symlink. ● To blacklist a service systemctl mask S.service ● 'rm' or 'ln' can manage the services: there is no binary 'registry' DB.
  • 27. Exercise 2: Make HelloWorld.service run at Boot ● Modify HelloWorld.service. ● Enable it. ● Reboot and verify that the service is now started. ● Disable the service, reboot and verify that service is not started.
  • 28. Solution: make HelloWorld.Service run at boot ● Append a “WantedBy” line to a new [Install] section in the unit: [Install] WantedBy=multi-user.target ● Boot container and enable the unit: sudo systemd-nspawn -bD /var/lib/machines/debian [inside container] sudo systemctl enable HelloWorld [inside container] ls /etc/systemd/system/multi-user.target.wants ● Reboot and check status: [inside container] sudo systemctl reboot [inside container] systemctl status HelloWorld ● Disable the service, reboot and check again: [inside container] sudo systemctl disable HelloWorld [fails if the file is cp'ed, not ln'ed] [inside container] sudo systemctl reboot [inside container] systemctl status HelloWorld
  • 30. Demo: Generate ASCII Dependency Graphs Examples: systemctl list-dependencies basic.target systemctl list-dependencies --after cups.socket systemctl list-dependencies --before multi-user.target
  • 31. Generate dependency metadata: systemd-analyze dot basic.target > basic.dot Generate graph image: dot -Tsvg basic.dot -o basic.svg View graph: eog basic.svg (or view basic.svg with any web browser) Note: dot is in graphviz package; eog is in eponymous one. Generate SVG Dependency Graph
  • 32. systemd bootup is ordered, but not deterministic ● Services start other services they 'Want' or 'Require'. ● Services stop if other services they 'Require' stop, but not if services they 'Want' stop. ● 'After' means 'start after another service starts'. – Not 'start after another service is fully initialized' or finished. – 'Before' is similar. ● To express more nuanced sequence, use Path, PID or Socket- based signalling. Examples: – ConditionPathExists= in unit file listing /var/run/*.pid – systemd-notify messages to socket FAQ
  • 34. Not all targets are 'runlevels' ● Targets can simply be collections of services all started at once. ● A runlevel is a special target that is reached only when all wanted services reach completion. ● RTFM: man systemd.special ● New simple targets = new unit files + directories with symlinks. ● New runlevels require new code. courtesyPierre-YvesBeaudoin FAQ
  • 35. FAQ: how do I create a new runlevel? ● You don't want to. – Doing so involves writing a bunch of C/C++ code. ● Creating a new runlevel is possible. – GENIVI automotive Linux project has done it. – Code is available from git://git.projects.genivi.org/lifecycle/node-startup-controller.git – Webcast slides and audio – Use case: a LAN with many dumb no-OS MCUs. ● Is your use case truly so different from those considered by freedesktop.org?
  • 36. From GENIVI Lifecycle Management webcast slides; the source code
  • 38. 38 system and user system instances ● systemd's system instance manages singleton daemons that provide systemwide services; ● systemd's user instance manages per-user services. ● Try: – systemctl --user status ● Discuss: why does systemctl --user status fail? ● Configuration files are in $HOME, not /etc/systemd. ● User instance only runs if systemd is built with PAM feature: systemctl --version | grep PAM
  • 39. 39 system and user units ● Organized into system and user units. ● /lib/systemd/system: systemd upstream's defaults for system-wide services ● /usr/lib/systemd/user/: systemd upstream's defaults for per-user services ● $HOME/.local/share/systemd/user/ for user-installed units ● 'drop-ins' are run-time extensions (man systemd.unit) for either user or system instances.
  • 40. 40 Precedence of system unit files Tip: create unit files for new services in /etc. Drop-ins are for override. lowest; from upstream optional; static optional; dynamically generated alternatives that produce the same result highest; optional; static in /etc/systemd/system/<unit-name>.d/foo.conf in /etc/systemd/system/foo.service in /run/systemd/system/foo.service in /lib/systemd/system/foo.service man systemd.unit
  • 41. 41 Exercise 3:Understanding unit file hierarchy ● Display path and text of currently loaded unit file. systemctl cat systemd-logind ● Copy the currently loaded unit to a position higher in the unit-file hierarchy. sudo cp /lib/systemd/system/systemd-logind.service /etc/systemd/system ● Try: systemctl cat systemd-logind – Is the result what you expected? Why? ● Another clue: systemd-delta
  • 42. 42 Unit file hierarchy puzzle: the answer ● sudo systemctl daemon-reload ● systemctl cat systemd-logind ● Clean-up. (Why is this important?) – sudo rm /etc/systemd/system/systemd-logind.service ● And repeat sudo systemctl daemon-reload FAQ
  • 44. and Upstart Serial Linked list Fully parallel Socket-based activation is key to systemd's fast boot
  • 45. Demo:control cups via socket-based activation ● Check if cups is running and stop it: systemctl status cups.service sudo systemctl stop cups.service systemctl status cups.service ● What is cups.socket? systemctl cat cups.socket systemctl status cups.socket ● What is the difference between /lib/systemd/system/cups.socket and /var/run/cups/cups.sock? ● cups.sock is a normal AF_UNIX socket, so echo “HTTP POST” | ncat -U /var/run/cups/cups.socket ● Now check cups.service: systemctl status cups.service
  • 46. Tune and control your configuration with systemd
  • 47. systemd intuitively exposes kernel interfaces ● Including Capabilities, Watchdog, Cgroups and kdbus ('coming attraction') ● Kernel features are configurable via systemd's unit files. ● Encourages creation of system-wide policies via unit templates. ● man 7 capabilities
  • 48. systemd and cgroups ● cgroups were difficult to config prior to advent of systemd tools. ● cgroups are a kernel-level mechanism for allocating resources: storage, memory, CPU and network. ● slices are groups of services whose resources are managed jointly. ● systemd scopes are resultant groups of processes. ● Sysadmins can set BlockIOWeight, IOSchedulingPriority, OOMScoreAdjust, CPUShares, MemoryLimit, Nice … ● Reference: kernel's documentation and 'man systemd.resource- control'
  • 49. From GENIVI Lifecycle Management webcast slides (GENIVI automotive Linux consortium)
  • 50. check cgroup configuration on your current system ● systemd-cgls ● systemd-cgtop ● mount | grep cgroup shows which 'controllers' are available ● NOTE: Which controllers are available depends on the kernel config: grep CGROUP /boot/config* ● NOTE: unless "CPUAccounting=1", "MemoryAccounting=1" and "BlockIOAccounting=1" are enabled for the services in question, no resource accounting will be available for system services and the data shown by systemd-cgtop will be incomplete.
  • 51. Exercise 4: set 'niceness' of Firefox ● Create a service that starts Firefox with per-user settings in firefox.slice. ● Set the 'niceness' of Firefox. ● Check that the process runs at the 'niceness' you've set. ● Hints: – You may need to run 'xhost +localhost' on localhost. – Possibly add 'Environment=DISPLAY=:0' to your unit file. – man systemd.exec
  • 52. Solution: nice Firefox ● Create a firefox.service file in /usr/lib/systemd/user: [Unit] Description=Firefox web browser [Service] Environment=DISPLAY=:0 ExecStart=/usr/bin/firefox (might be /bin/firefox) Nice=12 Slice=firefox.slice (optional but worth trying to see its effect) ● systemctl --user start firefox ● systemd-cgls ● Employ ps or top to check 'niceness'. ● Note that you now need systemctl --user enable firefox systemctl --user daemon-reload journalctl –user-unit=firefox (not journalctl --user though)
  • 53. systemd and security: granular encapsulationvia kernel's capabilities ● CapabilityBoundingSet at boot; capability dropping possible ● PrivateTmp, PrivateDevices, PrivateNetwork, JoinNamespaces ● ProtectSystem (/usr and /etc), ProtectHome ● ReadOnlyDirectories, InaccessibleDirectories ● Set system-wide security policies via /etc/systemd/*conf files ● References: LWN on “Inheriting capabilities” and man capabilities
  • 54. Exercise 6: control file access of firefox.service ● Add 'CapabilityBoundingSet=' to firefox.service and restart. – Investigate with getpcaps, journalctl and systemctl. (getpcaps may not be in your default $PATH.) ● Replace CapabilityBoundingSet directive with 'InaccessibleDirectories=/home'. ● Move to /etc/systemd/system and restart. – Try to read files in /home with the browser after starting it from 'sudo -i'. – Explain the behavior. ● Don't forget 'systemctl daemon-reload' and '--user'.
  • 55. Solution: limiting Firefox's access ● Starting firefox.service as jack, from /etc/systemd/user, with CapabilityBoundingSet= [jack@f22container ~]$ systemctl --user daemon-reload [jack@f22container ~]$ systemctl --user start firefox [jack@f22container ~]$ systemctl --user --failed UNIT LOAD ACTIVE SUB DESCRIPTION ● firefox.service loaded failed failed Firefox web browser [jack@f22container ~]$ journalctl --user -p err Sep 19 16:44:03 f22container systemd[300]: Failed at step CAPABILITIES spawning /bin/firefox: Operation not permitted
  • 56. Solution: limiting Firefox's access ● Starting firefox.service with sudo from /etc/systemd/system, without 'CapabilityBoundingSet=', bash-4.3# getpcaps `pidof firefox` Capabilities for `1923': = cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,ca p_setuid,cap_setpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_ra w,cap_ipc_owner,cap_sys_chroot,cap_sys_ptrace,cap_sys_admin,cap_sys_boot,cap_sys_nice,ca p_sys_resource,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap _setfcap+ep ● With 'CapabilityBoundingSet=', bash-4.3# systemctl daemon-reload bash-4.3# getpcaps `pidof firefox` Capabilities for `2036': = ● A bit simpler than SELinux!
  • 57. Solution: limit Firefox's access ● Starting firefox.service as root from /etc/systemd/system and without 'InaccessibleDirectories=/home', ● Starting firefox.service as root from /etc/systemd/system and with 'InaccessibleDirectories=/home',
  • 59. ProTips! When all else fails, consult the files in /etc/systemd/*.conf. Dump all potential configuration items: /lib/systemd/systemd --dump-configuration-items Most useful man pages: man systemd.exec man systemd.unit man systemd.service Consult systemd mailing list archives and wiki.
  • 60. A bit more about the systemd journal ● In binary format, but has a simple UI that beats 'grep' and 'awk'. ● Is fully compatible with parallel syslog output. ● Can push the journal to a remote via unit file configuration. ● Can be automatically cryptographically signed. ● Is, with udev, one of the required systemd components.
  • 61. ● Test out new units by trying them: – systemd-analyze verify <new unit> – in /run – in *.conf.d directory – via bootargs ● Do not ever modify files in /lib/systemd. – Restore defaults by removing broken units with higher precedence. ● Services linked into basic.target.wants (≈runlevel 1) that won't work until graphical.target (runlevel 5) will start properly if their dependencies are correctly stated. systemd prevents self-injury!
  • 62. systemd's watchdog timer support ● Provides simple configuration of soft or hard watchdogs. ● RuntimeWatchdogSec sets a timer for petting the dog. ● ShutdownWatchdogSec sets a timer to force reboot if shutdown hangs. 62
  • 63. 'systemd-analyze critical-chain': Why did that unit take so long to start? Note: ntp was started by SysVinit!!
  • 64. Final quiz ● T/F: systemd is best characterized as an init system. ● Which of the following is not a recommended way to customize systemd? a Edit /etc/systemd/*.conf files; b Edit the files in /lib/systemd/system; c Edit /etc/systemd/<unit-name.d>/*.conf files; d Employ “systemctl enable” and “systemctl disable”. ● Which of the following is not a real systemd component? systemd-nspawn, systemd-logind, packagectl, systemd-delta ● Which of the following is true? The systemd journal: a is incompatible with syslog; b can be viewed with systemd-journalviewer or a browser; c can be cryptographically signed automatically; d is configured via an XML file. ● T/F: systemd services are always started via socket-based activation.
  • 65. Summary ● systemd is easier to configure and customize than you fear. ● Most users will not notice (or have not noticed). ● There are real difficulties but – systemd is still relatively new; – system administration is complex.
  • 66. Additional Resources ● Man pages are part of systemd git repo. ● freedesktop.org: systemd mailing list archives and wiki; Pöttering's blog ● #systemd on Freenode IRC ● ➟At wayback machine: “Booting up” articles ● systemd.conf YouTube channel and slides ● Neil Brown series at LWN on 'systemd programming' (design of NFS units) ● ➟Fedora's SysVinit to systemd cheatsheet ● LWN on “How Debian managed the systemd transition ” ● Linux Action Show interview with Lennart Poettering ● “Who wrote systemd?” statistics ● Jordan Hubbard of FreeBSD describes launchd porting plans (at 40 mins.)
  • 67. Acknowledgements https://commons.wikimedia.org/wiki/File:Pronam-mudra.png#/media/File:Pronam-mudra.png • twb and ohsix on #systemd on freenode IRC • Zbigniew Jędrzejewski-Szmek on systemd-devel • Kevin Dankwardt for help with organizing class • USENIX/LISA for invitation.
  • 68. Course evaluation ● The course was too introductory/too advanced. ● The amount of lecture versus exercises was too high/too low. ● The course content is relevant to my work: T/F. ● I now understand systemd better: T/F. ● I know how to find more information about systemd: T/F. Email to alison@she-devel.com
  • 69. 69 system and user units derive from D-Bus ● systemd cooperates with D-Bus to provide: – singleton daemons that provide systemwide services; – per-user services. ● Try: – busctl --system | head – busctl --user | head ● Same information is accessible via qdbus or gdbus. ● Reference: “Control your Linux desktop with D-Bus”
  • 70. Exercise: control firefox's memory utilization ● The following works on systems where localhost's kernel is compiled with CONFIG_MEMCG=y. – Don't forget that containers share the kernel with localhost. ● Create a unit file that will start firefox. ● Turn on memory accounting. ● Check firefox's memory accounting via systemd-cgtop. ● Add a MemoryLimit field to the unit file. ● Restart your service and check the memory utilization again: top or ps -o slice,vsize,rss,%mem -C firefox. ● Hints: you may need to run 'xhost +localhost' on localhost and add 'Environment=DISPLAY=:0' to your unit file.
  • 71. Firefox and cgroups solution ● firefox.service: [Unit] Description=Firefox web browser [Service] Environment=DISPLAY=:0 ExecStart=/usr/bin/firefox (or /bin/firefox) MemoryAccounting=true MemoryLimit=10M ● sudo mv firefox.service /etc/systemd/user ● systemctl --user start firefox ● systemd-cgtop and ps -o slice,vsize,rss,%mem -C firefox ● Remove MemoryLimit and compare.
  • 72. Taxonomy of systemd tools ● Analogous to 'git'. ● 'Porcelain' generalized tools: 'ls /bin/*ctl' – journalctl, systemctl, machinectl, busctl, loginctl, networkctl – Man pages, useful in bash scripts. ● 'Plumbing' components: 'find /lib/systemd -executable -type f' – A few lack man pages; try '--help'. – Tools that are invoked by other tools. – May be useful in testing. ● Domain-specific: 'ls /usr/bin/systemd-*' "20060513 toolbox" by Per Erik Strandberg sv:User:PER9000 - Own work. Licensed under CC BY-SA 2.5 via Commons - https://commons.wikimedia.org/wiki/File:20060513_toolbox.jpg#/media/File:20060513_toolbox.jpg