[systemd-devel] minimal required units

Alison Chaiken alison at she-devel.com
Thu Mar 12 11:39:10 PDT 2015


Aaron_Wright at selinc.com writes:
> Just for illustration purposes, here are few units listed in
> systemd.special, that I don't feel like I need, but which I'm left
> wondering if systemd needs them:
> cryptsetup.target
> display-manager.service
> getty.target
> graphical.target
> hibernate.target
> hybrid-sleep.target
> halt.target
> initrd-fs.target
> kbrequest.target
> multi-user.target
> network-online.target
> poweroff.target
> remote-fs.target
> initrd-root-fs.target
> runlevel*.target
> sigpwr.target
> sleep.target
> suspend.target
> swap.target

The right way to think about targets in systemd is as synchronous
points.   If target A Requires target B and is After it, then target A
won't try to start until after target B is ready in the sd_notify()
sense.   The targets are part of the signaling system for systemd's
sequencing method.     Neil Brown's article at LWN
(https://lwn.net/Articles/584176/) discusses how targets can be used
to pass configuration signals between services.    A target that can
be 'isolated' is akin to a run-level, but a target that cannot be
isolated is used for synchronization or signaling.

Some targets may be useful even if you don't strictly need them.   For
example, we old people may prefer to append '3' to bootargs when we
want to come up to the text console, and runlevel3.target provides
that capability.   You can, assuredly, append
'systemd.unit=multi-user.target' to bootargs instead.

The targets contribute to the file count, but not much to the binary
size.    For embedded in general, it seems better not to touch
upstream bits if they don't make the binary larger.      Removing
services you don't need also must be done with caution.   For example,
I found out the hard way that getting rid of PAM means no 'systemctl
--user' commands will work.

Consider choosing different options when running configure.    That
interface should in principle cleanly remove file sets corresponding
to individual features.   Removing individual files is always more
dangerous.

-- Alison


-- 
Alison Chaiken                           alison at she-devel.com
650-279-5600
http://{she-devel.com,exerciseforthereader.org}
One consumes a great deal of silence in the course of becoming
educated. -- Matthew B. Crawford


More information about the systemd-devel mailing list