[systemd-devel] Please help: systemd "special targets" activaton order for fast boot

Chaiken, Alison Alison_Chaiken at mentor.com
Fri Sep 5 09:17:13 PDT 2014


Vibin Viswambharan asks:
>1/ Is there a recommended way to re-organize the boot target order 

Vibin, welcome to the wonderful world of systemd, which, contrary to FUD, is much easier to use than SysVinit.   You're off to a solid start given that you've found the man pages, but you'll also want to consult "systemd for Administrators" at 

http://0pointer.net/blog/index2.html

and particularly in getting started

https://web.archive.org/web/20131206191347/http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html

It's quite easy to reorganize the boot order by creating custom levels and putting whatever actions or daemons in them you like.    Systemd is more foolproof than SysVinit since putting a daemon in the first target that depends on something in the eighth target will result in the that early daemon simply waiting until its dependence is ready.   The original configuration in /lib/systemd need not be modified to experiment since you can override it by making your changes in /etc/systemd.

For the automotive fastboot case that concerns you, there are definitely industry-specific best practices.   Clearly you can remove services you don't need, mount filesystems needed for rear-view camera before those needed for navigation and media, defer initialization of less important devices, etc.   Notably the systemd-readahead feature that is under threat of deprecation is widely used in automotive, and behind the scenes some of us are discussing a way to support it going forward.

>2/ Is there a way to define custom target like "early-boot.target" 

Yes, you will certainly want to do that in /etc/systemd.    Read the section on "Wants and needs" at 

https://web.archive.org/web/20131208125730/http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html?page=3

(BTW, Lennart and Kai, is there a reason this great article couldn't be hosted at freedesktop.org or 0pointer.de?)

>3/ Is there any special consideration to disable these special targets like (swap.target,local-fs target if they are not >used in the embedded devices?).

For any targets that include no services you want, remove them from the filesystem: it's that simple.

Best wishes,
Alison Chaiken
alison_chaiken at mentor.com



More information about the systemd-devel mailing list