2

I am using meta-raspberrypi to build my raspberrypi image

I see an increased boot time of about 2 seconds with systemd when compared to SysV.

Systemv_Systemd_kernel_log_comp

I don't derive much information form the kernel log.

systemd

[    4.452082] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    8.111375] i2c /dev entries driver
[    8.284057] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered

SysV

[    3.839449] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    5.990874] i2c /dev entries driver
[    6.136112] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered

As it can be seen above systemd spends some extra time after the basic kernel boot and before loading the i2c kernel module.

I am assuming this time is spent in starting up the systemd services.

If yes, how can I check which services are started and how much time each of then is taking?

migrated from raspberrypi.stackexchange.com Oct 5 '17 at 11:55

This question came from our site for users and developers of hardware and software for Raspberry Pi.

  • Seems to me there is a very, very clear message about why the one on the left has paused to "regenerate the udev cache". Not to say that is the issue, but you should eliminate it as a possibility. – goldilocks Oct 5 '17 at 11:33
  • 1
    Thanks @goldilocks I saw the udev message. Actually onto the left is systemv. Though it paused it ended up taking less time which is again not very clear to me why! Anyway, I flagged it and requested to migrate – mk.. Oct 5 '17 at 11:43
  • 1
    Something is a little suspect here. Both logs include INIT: version 2.88 -- which is not systemd. Also, systemd messages would be prefaced with (e.g.) "systemd[1]". I think both of these are SysV init boots. – goldilocks Oct 5 '17 at 12:18
  • 1
    Yes @goldilocks Thanks for pointing it out. I enabled systemd in my yocto distribution but it looks like I have to also remove systemv. I did that. Now, I have a real systemd bsaed environment and I dont see any logs with INIT version.. However systemd is starting so any services that i dont need. I wil now use the systemd-analyze and remove/disable them. Thank you very much. – mk.. Oct 5 '17 at 13:10
  • @goldilocks Please edit your answer with the above comment. – mk.. Oct 5 '17 at 13:11
1

First, I'd observe that both of the outputs in your question are from SysV init (INIT: version 2.88), so at some point you have become confused.

Anyway, WRT the timing of various services, you can get a pretty snazzy SVG with systemd-analyze plot > sysd.svg (the redirection here is necessary, otherwise it prints SVG data to standard output, which is not very useful):

enter image description here

There's no choice of output format, but this one (from a B+ running Raspbian 8) was turned into a JPEG with convert sysd.svg sysd.jpg (convert is part of ImageMagick, which is available on any linux distro).

A simpler text list is available with systemd-analyze blame.

systemd is starting so any services that i dont need

Probably, but generally those won't take any time. E.g., if some service is in charge of setting up NFS, but you haven't configured any such filesystems, it won't take up any time or resources.

Of course in the interest of tidyness you may want to get rid of them anyway. Make sure you are certain what something is for first. systemctl list-units is useful here as by default it provides a simple list of loaded services. Systemd has a lot of man pages; you can find them with apropos systemd (if you don't get any output, try sudo mandb first, for whatever reason sometimes this is not kept up on some distros). Many of those are guides to writing service files; to limit it strictly to commands use apropos -s 1 systemd.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.