Introduction

It's a common fact that desktop workstations tend to be rebooted more often than servers, especially if that workstation is a laptop.

There are some common ways to decrease the time it takes to boot including:


Removing the unnecessary services

For this, one should provide ways for neophyte users to choose the services they need and the ones they don't.

The problem is that, as a lot of GNU softwares, the documentation is not very novice-friendly. A new option in the style "service {start||stop||...||info}" can be of some help even if it is still not the solution. (Michel Nolard)

With most packages you can run: apt-cache show <packagename> since packagename is usually the same as the init.d script name. If they aren't the same you can use dpkg to get the name of the package that owns that file.


Parallelizing services startup

We could replace the "init" process with "runit" to make services start in parallel.

For my own, I think that Debian MUST use such an architecture for the next stable release. We've been stuck for ways too long with prehistoric technologies and constraints. Free software is not a synonym for static technologies. (Michel Nolard)


Using a sleep mode

We can {add patches to the kernel}/{install a tool and register it in /etc/inittab} in order to make profit of the disk space used by the swaps to obtain VERY fast boot a la sleep mode in most circumstances. This can make your boot done under 5 secs after bios initialization. But swapon can't be launched before the hardware has been initialized (see [http://mlf.linux.rulez.org/Archivum/linux-hw-199903/msg00020.html a mail]), so a solution must be found. (Michel Nolard)


Changing your init levels and script ordering

The Debian system by default runs at runlevel/initdefault 2. This means that every service you have to watch while booting gets started by their symlink order in the /etc/rc2.d directory or their settings in file-rc for init 2.

If you have some services that you rarely use, especially if they take a long time to start and stop like netatalk or databases and mud servers, just use update-rc.d to purge all of the symlinks with the force option, then re-create the symlinks in the rc2+n.d levels. (eg put databases you frequently use in run level 3/rc3.d and slower stuff you almost never use in run level 4/rc4.d.) You can then 'activate' these 'groups' by running init <n> (eg init 3 or init 4) as root, even from in X. The in-progress dbus system may help the activating of services after X is started be a more intuitive process.

You can also play around with the boot order and see what things you can delay until later in the boot process (maybe even after X starts?)

Note: Remember to leave/re-make the stop links in levels 0, 1 and 6 for halt, single user and reboot respectivly. See: man init

Background:

Being a ex RH user, I had at one time been frustrated and annoyed with update-rc.d for it's requirement of having at least one symlink to keep it from rebuilding the links on the next upgrade and it's (in my hands) kludgy feel compared to chkconfig.

I wanted invoke-rc.d service start||stop ability for those infrequently used services, but I didn't want them running by default and I didn't want to uninstall them just to re-install the next time I wanted to use the services. (Uninstalling or deleting the init.d script was suggested to me on debian-user).

I also had a little bit of an adjustment at the use of only one run level instead of multiple init's like in RH (2=multi no network, 3=multi w network, 5=multi w X-windows).

The aforementioned solution is my way of combining the two quirks into a solution that seems to work for me. -- JacobAnawalt


Some related links