Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I was wondering if I could manage to initialize drivers, services etc. (all these jobs what Linux does during startup) in parallel instead of sequentially. I want to aggressively lower the boot time. I know some services depend on each other but to make an easy example: during probing the network devices, it shall take care of the audio too, instead of waiting 10 s until the network is ready.

I heard of concepts like systemd and InitNG but I'm sure there has to be other methods. Isn't there an option or flag for the kernel itself to boot this way?

share|improve this question
2  
the kernel already does that. you have to look into the init system in order to achieve parallel boot. The things you are talking about (network ready) etc. are all userspace related and have not much to do with the kernel –  Ulrich Dangel Jan 21 at 12:41
1  
You want to look at LPC: Booting Linux in five seconds –  Timo Jan 21 at 12:48
1  
Take a look on systemd : wiki.archlinux.org/index.php/systemd From the main description: systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. –  vfbsilva Jan 21 at 12:50
1  
Take a look here: linux.org/threads/init-and-its-alternatives.4876 –  vfbsilva Jan 21 at 12:54
2  
@user3085931 systemd is anything else but bloated. See also item#12 here. Sure, it requires a bit more storage (not memory) than other init-systems, but you'll save this on the other hand by not installing all the other components you'd need on a non-systemd setup. Besides that, you can still to choose not to build selected systemd components which you don't want to have on your setup. –  Elias Probst Jan 21 at 15:25
show 5 more comments

closed as too broad by Ulrich Dangel, Anthon, jasonwryan, slm, jordanm Jan 22 at 5:12

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 1 down vote accepted

Look at the CONCURRENCY variable in /etc/init.d/rc, you have several choices.
When set to makefile, then the init process does it in parallel.

There are different comments depending your distribution:

#
# Check if we are able to use make like booting.  It require the
# insserv package to be enabled. Boot concurrency also requires
# startpar to be installed.
#
CONCURRENCY=makefile
# Specify method used to enable concurrent init.d scripts.
# Valid options are 'none' and 'makefile'.  Obsolete options
# used earlier are 'shell' and 'startpar'.  The obsolete options
# are aliases for 'makefile' since 2010-05-14.  The default since
# the same date is 'makefile', as the init.d scripts in Debian now
# include dependency information and are ordered using this
# information.  See insserv for information on dependency based
# boot sequencing.
#CONCURRENCY=makefile
CONCURRENCY=none

See also the line in your init script:

eval "$(startpar -p 4 -t 20 -T 3 -M $1 -P $previous -R $runlevel)"

See also man startpar

Good hint from Timo: The Bootchart package lets you visualize your boot process.

Good reads: init, SysV, History

[edit]

It is often difficult to use bootchart, so here a howto:

Bootchart Micro Howto

  • install it apt-get install bootchart2 pybootchartgui
  • reboot
  • in the boot screen of grub press e for edit. then find the line with kernel boot parameters and add init=/sbin/bootchartd
  • press F10 for boot
  • after you OS is up and running open a terminal window and run sudo pybootchartgui
  • you'll find your bootchart.png in the working directory
share|improve this answer
    
sounds like I have to take care of threading ? –  user3085931 Jan 21 at 15:41
    
startpar takes care of parallelism. –  bersch Jan 21 at 16:02
    
the startpar is new for me, thanks I'll have a look on it –  user3085931 Jan 22 at 7:11
1  
You normally don't need to touch startpar. I'd first try bootchart, then you know which process slows down the boot sequence. The makefile option sometimes considered unstable, so you need also take look at the dependencies of the start scripts. –  bersch Jan 22 at 11:17
add comment

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