Re: [systemd-devel] minimal required units

2015-03-12 Thread Andrei Borzenkov
В Thu, 12 Mar 2015 13:49:38 -0700
aaron_wri...@selinc.com пишет:

 Andrei Borzenkov arvidj...@gmail.com wrote on 03/12/2015 12:18:15 PM:
 
  From: Andrei Borzenkov arvidj...@gmail.com
  To: aaron_wri...@selinc.com
  Cc: systemd-devel@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_wri...@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.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Aaron_Wright
Andrei Borzenkov arvidj...@gmail.com wrote on 03/11/2015 08:47:43 PM:

 From: Andrei Borzenkov arvidj...@gmail.com
 To: aaron_wri...@selinc.com
 Cc: systemd-devel@lists.freedesktop.org
 Date: 03/11/2015 08:47 PM
 Subject: Re: [systemd-devel] minimal required units
 
 В Wed, 11 Mar 2015 12:02:29 -0700
 aaron_wri...@selinc.com пишет:
 
  I'm trying to make an embedded device, and I would like to start with 
the 
  minimal setup as possible. Are there some units that are required by 
  systemd?
  I ask because systemd is complaining about a missing rescue.target 
unit, 
 
 When does it do it?

It was doing this because my default unit was not set correctly. But that 
isn't really the question. The question is, what units are required by 
systemd? How can I figure that out? It seems like rescue.target, 
local-fs.target, and local-fs-pre.target are required, but I've only 
discovered that after trial and error. I know the systemd.special man page 
lists a ton of special units, but it seems that not all of them are 
required. Right? Well, which ones are? I feel like I need to look through 
the code to see when a hardcoded unit is referenced, like rescue.target 
was, that I don't know about.

My device doesn't have many of the same requirements of a full desktop or 
server Linux, so I'm trying to strip out things from systemd, unit wise, 
that I don't want or need. I've customized sysinit.target and basic.target 
to just reference the units I want. And that seems to be going smooth, but 
it appears there are other units, that I didn't know about that are 
required, but that aren't documented as such (that I could find). This 
scares me a bit.
 
 
  but I don't list rescue.target as a dependency of any other unit.
  However, grep tells me that /usr/lib/systemd/systemd contains the 
  rescue.target string, which worries me. Is there a list of all the 
units 
  that are required, even though no other unit lists them?

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Peter Sztan
Sorry for the noise, I have now read that you have already seen it.

On Thu, Mar 12, 2015 at 5:32 PM, Peter Sztan sztan...@gmail.com wrote:
 man 7 systemd.special

 On Thu, Mar 12, 2015 at 4:41 PM,  aaron_wri...@selinc.com wrote:
 Andrei Borzenkov arvidj...@gmail.com wrote on 03/11/2015 08:47:43 PM:

 From: Andrei Borzenkov arvidj...@gmail.com
 To: aaron_wri...@selinc.com
 Cc: systemd-devel@lists.freedesktop.org
 Date: 03/11/2015 08:47 PM
 Subject: Re: [systemd-devel] minimal required units

 В Wed, 11 Mar 2015 12:02:29 -0700
 aaron_wri...@selinc.com пишет:

  I'm trying to make an embedded device, and I would like to start with
  the
  minimal setup as possible. Are there some units that are required by
  systemd?
  I ask because systemd is complaining about a missing rescue.target unit,

 When does it do it?

 It was doing this because my default unit was not set correctly. But that
 isn't really the question. The question is, what units are required by
 systemd? How can I figure that out? It seems like rescue.target,
 local-fs.target, and local-fs-pre.target are required, but I've only
 discovered that after trial and error. I know the systemd.special man page
 lists a ton of special units, but it seems that not all of them are
 required. Right? Well, which ones are? I feel like I need to look through
 the code to see when a hardcoded unit is referenced, like rescue.target was,
 that I don't know about.

 My device doesn't have many of the same requirements of a full desktop or
 server Linux, so I'm trying to strip out things from systemd, unit wise,
 that I don't want or need. I've customized sysinit.target and basic.target
 to just reference the units I want. And that seems to be going smooth, but
 it appears there are other units, that I didn't know about that are
 required, but that aren't documented as such (that I could find). This
 scares me a bit.


  but I don't list rescue.target as a dependency of any other unit.
  However, grep tells me that /usr/lib/systemd/systemd contains the
  rescue.target string, which worries me. Is there a list of all the
  units
  that are required, even though no other unit lists them?

 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Andrei Borzenkov
В Thu, 12 Mar 2015 09:42:25 -0700
aaron_wri...@selinc.com пишет:

 Peter Sztan sztan...@gmail.com wrote on 03/12/2015 09:33:38 AM:
 
  From: Peter Sztan sztan...@gmail.com
  To: aaron_wri...@selinc.com
  Cc: systemd Mailing List systemd-devel@lists.freedesktop.org
  Date: 03/12/2015 09:33 AM
  Subject: Re: [systemd-devel] minimal required units
  
  Sorry for the noise, I have now read that you have already seen it.
  
 
 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
 

targets serve as common reference for collection of other units
(services). They do not do anything by themselves, there is absolutely
no reason to remove them. Some of them (at least those mentioned in
systemd.special) do have special meaning and removing them will
actually break functionality.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Aaron_Wright
Peter Sztan sztan...@gmail.com wrote on 03/12/2015 09:33:38 AM:

 From: Peter Sztan sztan...@gmail.com
 To: aaron_wri...@selinc.com
 Cc: systemd Mailing List systemd-devel@lists.freedesktop.org
 Date: 03/12/2015 09:33 AM
 Subject: Re: [systemd-devel] minimal required units
 
 Sorry for the noise, I have now read that you have already seen it.
 

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

(and so on)

I can't tell from systemd.special if these are required or not.

 On Thu, Mar 12, 2015 at 5:32 PM, Peter Sztan sztan...@gmail.com wrote:
  man 7 systemd.special
 
  On Thu, Mar 12, 2015 at 4:41 PM,  aaron_wri...@selinc.com wrote:
  Andrei Borzenkov arvidj...@gmail.com wrote on 03/11/2015 08:47:43 
PM:
 
  From: Andrei Borzenkov arvidj...@gmail.com
  To: aaron_wri...@selinc.com
  Cc: systemd-devel@lists.freedesktop.org
  Date: 03/11/2015 08:47 PM
  Subject: Re: [systemd-devel] minimal required units
 
  В Wed, 11 Mar 2015 12:02:29 -0700
  aaron_wri...@selinc.com пишет:
 
   I'm trying to make an embedded device, and I would like to start 
with
   the
   minimal setup as possible. Are there some units that are required 
by
   systemd?
   I ask because systemd is complaining about a missing rescue.target 
unit,
 
  When does it do it?
 
  It was doing this because my default unit was not set correctly. But 
that
  isn't really the question. The question is, what units are required 
by
  systemd? How can I figure that out? It seems like rescue.target,
  local-fs.target, and local-fs-pre.target are required, but I've only
  discovered that after trial and error. I know the systemd.special man 
page
  lists a ton of special units, but it seems that not all of them are
  required. Right? Well, which ones are? I feel like I need to look 
through
  the code to see when a hardcoded unit is referenced, like 
 rescue.target was,
  that I don't know about.
 
  My device doesn't have many of the same requirements of a full 
desktop or
  server Linux, so I'm trying to strip out things from systemd, unit 
wise,
  that I don't want or need. I've customized sysinit.target and 
basic.target
  to just reference the units I want. And that seems to be going 
smooth, but
  it appears there are other units, that I didn't know about that are
  required, but that aren't documented as such (that I could find). 
This
  scares me a bit.
 
 
   but I don't list rescue.target as a dependency of any other unit.
   However, grep tells me that /usr/lib/systemd/systemd contains the
   rescue.target string, which worries me. Is there a list of all 
the
   units
   that are required, even though no other unit lists them?
 
  ___
  systemd-devel mailing list
  systemd-devel@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Aaron_Wright
Andrei Borzenkov arvidj...@gmail.com wrote on 03/12/2015 12:18:15 PM:

 From: Andrei Borzenkov arvidj...@gmail.com
 To: aaron_wri...@selinc.com
 Cc: systemd-devel@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_wri...@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? Though, that would include lots 
of things I don't need, such as cryptsetup.target, swap.target, mqueue, 
configfs, debugfs, etc.

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. So I got bit 
by there not being any documentation that says, local-fs.target is 
Required. Unless, I'm missing something.

PS - Thanks for pointing me at information. I'm still getting up to speed 
on systemd.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Peter Sztan
man 7 systemd.special

On Thu, Mar 12, 2015 at 4:41 PM,  aaron_wri...@selinc.com wrote:
 Andrei Borzenkov arvidj...@gmail.com wrote on 03/11/2015 08:47:43 PM:

 From: Andrei Borzenkov arvidj...@gmail.com
 To: aaron_wri...@selinc.com
 Cc: systemd-devel@lists.freedesktop.org
 Date: 03/11/2015 08:47 PM
 Subject: Re: [systemd-devel] minimal required units

 В Wed, 11 Mar 2015 12:02:29 -0700
 aaron_wri...@selinc.com пишет:

  I'm trying to make an embedded device, and I would like to start with
  the
  minimal setup as possible. Are there some units that are required by
  systemd?
  I ask because systemd is complaining about a missing rescue.target unit,

 When does it do it?

 It was doing this because my default unit was not set correctly. But that
 isn't really the question. The question is, what units are required by
 systemd? How can I figure that out? It seems like rescue.target,
 local-fs.target, and local-fs-pre.target are required, but I've only
 discovered that after trial and error. I know the systemd.special man page
 lists a ton of special units, but it seems that not all of them are
 required. Right? Well, which ones are? I feel like I need to look through
 the code to see when a hardcoded unit is referenced, like rescue.target was,
 that I don't know about.

 My device doesn't have many of the same requirements of a full desktop or
 server Linux, so I'm trying to strip out things from systemd, unit wise,
 that I don't want or need. I've customized sysinit.target and basic.target
 to just reference the units I want. And that seems to be going smooth, but
 it appears there are other units, that I didn't know about that are
 required, but that aren't documented as such (that I could find). This
 scares me a bit.


  but I don't list rescue.target as a dependency of any other unit.
  However, grep tells me that /usr/lib/systemd/systemd contains the
  rescue.target string, which worries me. Is there a list of all the
  units
  that are required, even though no other unit lists them?

 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Alison Chaiken
aaron_wri...@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   ali...@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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Aaron_Wright
Andrei Borzenkov arvidj...@gmail.com wrote on 03/12/2015 10:38:19 AM:

 From: Andrei Borzenkov arvidj...@gmail.com
 To: aaron_wri...@selinc.com
 Cc: systemd-devel@lists.freedesktop.org
 Date: 03/12/2015 10:38 AM
 Subject: Re: [systemd-devel] minimal required units
 
 В Thu, 12 Mar 2015 09:42:25 -0700
 aaron_wri...@selinc.com пишет:
 
  Peter Sztan sztan...@gmail.com wrote on 03/12/2015 09:33:38 AM:
  
   From: Peter Sztan sztan...@gmail.com
   To: aaron_wri...@selinc.com
   Cc: systemd Mailing List systemd-devel@lists.freedesktop.org
   Date: 03/12/2015 09:33 AM
   Subject: Re: [systemd-devel] minimal required units
   
   Sorry for the noise, I have now read that you have already seen it.
   
  
  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
  
 
 targets serve as common reference for collection of other units
 (services). They do not do anything by themselves, there is absolutely
 no reason to remove them. Some of them (at least those mentioned in
 systemd.special) do have special meaning and removing them will
 actually break functionality.

In my embedded environment I have to justify everything on the product. 
Given that the product doesn't have a monitor, I find that targets such as 
graphical.target or display-manager.target for example are hard to 
justify.

I would rather not just throw the whole systemd-kitchen-sink at the 
product and call it a day. It seems obvious that not all of the units 
referenced in systemd.special are actually required. Some of them don't 
even exist with my configuration (dbus.service, dbus.socket, 
runlevel*.target, etc).

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.

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).

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-12 Thread Andrei Borzenkov
В Thu, 12 Mar 2015 11:09:57 -0700
aaron_wri...@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.

 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)?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] minimal required units

2015-03-11 Thread Andrei Borzenkov
В Wed, 11 Mar 2015 12:02:29 -0700
aaron_wri...@selinc.com пишет:

 I'm trying to make an embedded device, and I would like to start with the 
 minimal setup as possible. Are there some units that are required by 
 systemd?
 I ask because systemd is complaining about a missing rescue.target unit, 

When does it do it? 

 but I don't list rescue.target as a dependency of any other unit.
 However, grep tells me that /usr/lib/systemd/systemd contains the 
 rescue.target string, which worries me. Is there a list of all the units 
 that are required, even though no other unit lists them?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel