[systemd-analyze time] somethings not right!

Over the weekend I came across a post on Reddit and being curious I gave it a look. I don’t really know anything about systemd and I have no idea how to track down this problem. Users space boot should be measured in seconds not minuets. The computer appears to boot quickly enough with the login coming after a few seconds and the desktop being useable but a little sluggish. There is something taking an age to start and I would like to figure out what.

stephen@stephen-MS-7760:~$ systemd-analyze time
Startup finished in 1.618s (kernel) + 1min 54.276s (userspace) = 1min 55.894s

You can gather more infos about specific processes using:

systemd-analyze blame

Cheers

> stephen@stephen-MS-7760:~$ systemd-analyze blame
>     1min 46.826s rc-local.service
>           6.782s NetworkManager-wait-online.service
>            308ms vboxdrv.service
>            247ms dev-sda1.device
>            136ms ModemManager.service
>            130ms networking.service
>            118ms apparmor.service
>            117ms NetworkManager.service
>            109ms grub-common.service
>            109ms systemd-modules-load.service
>            107ms mnt-617f1363\x2d12d2\x2d4762\x2d935f\x2dd0699f01e1ea.mount
>            103ms upower.service
>             95ms accounts-daemon.service
>             90ms geoclue.service
>             88ms ondemand.service
>             78ms speech-dispatcher.service
>             71ms binfmt-support.service
>             70ms wpa_supplicant.service
>             70ms udisks2.service
>             69ms systemd-logind.service
>             69ms apport.service
>             66ms systemd-udev-trigger.service
>             60ms irqbalance.service
>             59ms gpu-manager.service
>             53ms avahi-daemon.service
>             49ms systemd-tmpfiles-setup.service
>             42ms systemd-udevd.service
>             41ms systemd-journald.service
>             33ms colord.service
>             32ms lightdm.service
>             32ms systemd-journal-flush.service
>             31ms ntp.service
>             29ms console-setup.service
>             29ms systemd-tmpfiles-clean.service
>             27ms rsyslog.service
>             23ms alsa-restore.service
>             21ms polkitd.service
>             21ms plymouth-start.service
>             19ms systemd-tmpfiles-setup-dev.service
>             17ms lm-sensors.service
>             16ms mnt-32893926\x2d459f\x2d4883\x2d8ce7\x2dfc0bf6d1e4cb.mount
>             15ms resolvconf.service
>             13ms systemd-update-utmp.service
>             12ms [email protected]
>             11ms plymouth-read-write.service
>             10ms systemd-user-sessions.service
>              9ms dev-disk-by\x2duuid-62202449\x2dac8d\x2d4fdb\x2d9253\x2d2233db7
>              7ms proc-sys-fs-binfmt_misc.mount
>              7ms sys-kernel-debug.mount
>              7ms hddtemp.service
>              7ms dev-mqueue.mount
>              6ms dev-hugepages.mount
>              5ms ufw.service
>              5ms systemd-update-utmp-runlevel.service
>              5ms ureadahead-stop.service
>              5ms iio-sensor-proxy.service
>              5ms kmod-static-nodes.service
>              4ms systemd-remount-fs.service
>              3ms systemd-sysctl.service
>              3ms pppd-dns.service
>              2ms rtkit-daemon.service
>              2ms vboxautostart-service.service
>              2ms sys-fs-fuse-connections.mount
>              2ms plymouth-quit-wait.service
>              2ms vboxballoonctrl-service.service
>              1ms systemd-random-seed.service
>              1ms clamav-daemon.socket
>              1ms vboxweb-service.service
>              1ms snapd.socket
>            895us openvpn.service
> lines 48-70/70 (END)

Hi @PendragonUK,

further to @ouroumov’s suggestion, have you done all your system updates?:

Yes my system is completely up to date.

1 Like

Okay, try running the following terminal commands (Ctrl + Alt + t) and see if that helps?:

sudo apt-get --fix-missing install

The above command downloads and installs any missing packages on your system.

sudo apt-get --fix-broken install

The above command downloads and installs any broken dependencies on your system.

What do you have going on in /etc/rc.local?

Default is empty.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

https://raymii.org/s/tutorials/rc.local_support_on_Arch_Linux_and_systemd.html

https://bbs.archlinux.org/viewtopic.php?id=147790

Wolfman, I ran both commands and found nothing

v3xx
There is an extra line in my rc.local


fstrim /

I guess that is causing the slow start…

1 Like

You have a SSD? 1234

1 Like

There are a pair of SSD’s in my system along with a single HDD.

Comment out (#) that single entry and see what happens. I use only HDD so such a file would not show on my box.

1 Like

It most likely is fstrim causing a slow start. It’s trimming the SSDs file system before the system starts each time. Usually this command is executed automatically in newer versions with supported SSDs and runs as a weekly cron job by default.

2 Likes