2

My Gentoo system with OpenRC init takes a long time to start, about 24 seconds (measured from GRUB to GDM). I was wondering if there are any recommended ways how to improve this time. But there isn't much about this topic on the internet, what I found.

I have an Intel Core i5-6400 and a Samsung SSD 970 EVO Plus 500GB.

2 Answers 2

3

Everybody loves fast system startups, especially on a daily used desktop computer. 24 seconds is quite a slow startup time and I was able to reduce it to 9 seconds.

I will show you a few tips, with no need to touch your kernel.

/etc/rc.conf

Let's start with the OpenRC configuration file. There is an option called rc_parallel. By default, services are started one by one and when some service takes more time, it delays others. Setting rc_parallel="YES" allows the RC system to try and start services in parallel for a slight speed improvement. In my case, it was -5 seconds.

A also had to set rc_send_sighup="YES", rc_timeout_stopsec="10", rc_send_sigkill="YES", because xdm service didn't want to stop while shutting down the system.

rc-service, rc-update

Another important thing is to know, what services are actually starting. That's the output you see during startup. If you want to log this output, set rc_logger="YES" in /etc/rc.conf file. You can find here exact times, warning messages or errors.

Services are divided into so-called runlevels, which means the period, when are these services started. There are two runlevels involved in system startup. boot and default.

You can list all services and their runlevels with the command: rc-update show.
Or you can list all running and stopped services with: rc-status --servicelist

In my case, I found a few unnecessary services which I could safely disable. For example bluetooth, netmount or net.enp0s31f6 service to set my network interface. It was enabled even tho I use NetworkManager service. I didn't need these services and got another 10 seconds down by disabling them.

You can disable service in specific runlevel with the command: rc-update del <service> <runlevel>.

Always check, what a particular service does, before disabling it. You could end up with a broken system.


I hope this could help someone and save a little time I had to spend.

2

Try installing app-shells/dash package, and then making the /bin/sh symlink point to dash. The latter can be done manually or with the eselect sh subcommand.

The first distro which did this by default was Ubuntu more than 10 years ago (IIRC) and it made a bigger difference than trying to run the initscript in parallel, as the other answer recommends.

2
  • Great tip, thank you! I just tested it and it's approximately a 1-second improvement.
    – BlueManCZ
    Apr 10, 2020 at 17:50
  • Without rc_parallel it is about 14 seconds. With rc_parallel enabled, about 8 seconds. I guess on CPUs 10 years ago wasn't rc_parallel so effective as on today's multicores.
    – BlueManCZ
    Apr 10, 2020 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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