[systemd-devel] minimal required units

Andrei Borzenkov arvidjaar at gmail.com
Thu Mar 12 20:56:37 PDT 2015

В Thu, 12 Mar 2015 13:49:38 -0700
Aaron_Wright at selinc.com пишет:

> Andrei Borzenkov <arvidjaar at gmail.com> wrote on 03/12/2015 12:18:15 PM:
> > From: Andrei Borzenkov <arvidjaar at gmail.com>
> > To: Aaron_Wright at selinc.com
> > Cc: systemd-devel at lists.freedesktop.org
> > Date: 03/12/2015 12:18 PM
> > Subject: Re: [systemd-devel] minimal required units
> > 
> > В Thu, 12 Mar 2015 11:09:57 -0700
> > Aaron_Wright at selinc.com пишет:
> > 
> > > 
> > > I feel like there needs to be a list of required units to get base 
> > > functionality out of systemd. So that embedded guys like me can build 
> up a 
> > > system from scratch, instead of starting from full blown desktop 
> support 
> > > and guessing at what can be taken out.
> > > 
> > 
> > sysinit.target is supposed to get you minimal working system (more or
> > less what you got with single user in the past). It could be considered
> > as starting point. Most embedded systems I have seen were running
> > something very close to single user anyway.
> > 
> Right now, I'm starting with the basic.target. Gets me a few more features 
> than sysinit.target, such as timers, which I feel I can use in my product 
> to replace cron.
> > > My question is mainly about whether the list of actual required units 
> is 
> > > known, or if it is something that requires investigation (digging 
> through 
> > > a bunch of code).
> > > 
> > 
> > Did you see bootup(7)?
> Yes, I've read that a few times, and I love the diagram. It seems to 
> suggest to me that I can use basic.target as a good synchronization point, 
> and then add my units after that, which makes sense to me.
> If I include at least all of the units leading up to basic.target, would 
> that cover the units required by systemd?

systemd does not really require anything. Really. *You* (or your
system) require something to be started during boot and only you know
what should be started. You can use single service that calls /etc/rc
as starting point and split it up step by step.

Units shipped with systemd help to organize system startup in logical
steps and provide common hooks to plug your own extensions into.
Removing common hooks won't buy you anything but will make system less
flexible and harder to troubleshoot.

>                                          Though, that would include lots 
> of things I don't need, such as cryptsetup.target, swap.target, mqueue, 
> configfs, debugfs, etc.

If you do not use them, do not include them. But cryptsetup.target
or swap.target will not even appear if you do not have /etc/crypttab
or swaps and others you mention check whether they can be started.

> I'm concerned because I left out local-fs.target to begin with, as I don't 
> need systemd to mount anything, but that seemed to cause systemd to 
> unmount everything other than / and the kernel file systems.

Sorry, that does not fit. Either you "do not need to mount anything" or
"systemd unmount everything". What was there to unmount if you did not
mount anything in the first place? 

>                                                             So I got bit 
> by there not being any documentation that says, "local-fs.target is 
> Required". Unless, I'm missing something.

It is very hard to answer without seeing more details.

More information about the systemd-devel mailing list