1 What is systemd?
A dependency system for unix services.
And, a set of basic unix services to make a unix system usable.
And, a growing list of not quite so basic services
- NTP, networkd, timers (crond/atd)
From a programmers perspective, it's the mainloop phenomenon.
Solaris: Service Management Facility
Mac OSX: launchd
Ubuntu: upstart (until recently)
LSB (actually implements LSB deps)
- path (inotify triggers)
- timer (crond/atd)
- slice (cgroup)
- replace run levels
- default target at boot
- can isolate to just one target
5 Advantages - Design
Proper, explicit dependencies between system compontents
Starts components in parallel
A proper separation of concerns, lots of situations covered.
- configuration files are regular, simple to understand generally small
- OTOH, there are LOTS of options
Configuration is not runnable shell.
[Unit] Description=CUPS Scheduler Documentation=man:cupsd(8) [Service] ExecStart=/usr/sbin/cupsd -l Type=simple [Install] Also=cups.socket cups.path WantedBy=printer.target
Separate system and user daemons.
6 Advantages - Sysadmins
Modify configuration without modifying upstream configuration
Service watching (startup, watchdog, failure modes)
[EXTENDED] /lib/systemd/system/rc-local.service → /lib/systemd/system/rc-local.service.d/debian.conf [EXTENDED] /lib/systemd/system/systemd-timesyncd.service → /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf [EQUIVALENT] /etc/systemd/system/default.target → /lib/systemd/system/default.target 3 overridden configuration files found.
7 Advantages - Programming
Removal of some error and security prone code
- socket activation (e.g. privileged ports)
- user/group changing
8 Advantages - Provisioning
standardized cgroup controls
debootstrap ; systemd-spawn-boot * systemd takes care of all pseudo file systems for you
9 Advantages - Users
quick to boot
can reduce load later on (services start & stop as required)
- black = Requires
- dark blue = Requisite
- dark grey = Wants
- red = Conflicts
- green = After
- It’s really nice in theory, but in practice I’ve found it to be slow and buggy
It’s a little new, so LTS distros necessarily have older versions
- el7 has something like 200 patches
network-online.target is a bit flakey
- Unix is a graveyard of IPC, I don't feel DBUS is much better
- KDBUS means it will probably be around for ever.
Deeply hooked into linux specific details, not portable
- kernel api, cgroups, udev etc.
Some cool features relient on file system e.g. btrfs for snapshot
I haven’t had a chance to play with networkd yet, but it sounds like it’s going to be very good.
- It depends…
- systemd only supports start/stop/reload
- work with the daemon: oneshot/simple/forking/inetd
- integrate with systemd: notify, watchdog
- Every login, a separate systemd -> user is spawned
- Can override with .config/systemd files