from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

85346

userrating:

average rating: 1.2 (52 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Misc

Speeding up the boot process (next generation)

The idea is to preload the useful files into kernel buffer cache before they are needed. Since I/O can happen parallel to the other CPU intensive tasks during bootup, this leads to faster bootup and faster startup time for your chosen applications. Other projects use static lists to preload the files.

This tutorial uses an automated process of generating the "useful" prefetch database.

This is /etc/init.d/my-readahead.
Code:

#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        before syslog-ng
}

start() {
        ebegin "Starting readahead ROYALE"
        cat /etc/conf.d/* > /dev/null 2>&1 &
        cat /usr/lib/gconv/gconv-modules.cache > /dev/null 2>&1 &
        cat /usr/share/icons/gnome/icon-theme.cache > /dev/null 2>&1 &
        cat /usr/share/icons/hicolor/icon-theme.cache > /dev/null 2>&1 &
        cat `cat /etc/conf.d/sofile-list.load` > /dev/null 2>&1 &
        if [ -f /forcesampler ];then
                /usr/sbin/sample-init-process /etc/conf.d/sofile-list.load &
                rm -f /forcesampler
        fi 
        eend 0
}

stop() {
        eend 0
}

The executable shell script /usr/sbin/sample-init-process:
Code:

 #!/bin/bash
final_db="$1"

# total number of lists to keep in /etc/conf.d/
total_to_keep=4

# total number of samples to make in /forcesampler boot.
# It will take twice this amount of seconds to finish sampling.
total_samples_per_boot=200

# touch empty file if not there
[ ! -f "$final_db" ] && touch "$final_db"

let i=0
while [ "$i" -ne "$total_to_keep" ] ; do
        if [ ! -f "$final_db$i" ] ; then
                break;
        else
                j=$((i+1))
                if [ "$j" = "$total_to_keep" ] ;then
                        j=0
                fi
                if [ -f "$final_db$j" -a "$final_db$i" -nt "$final_db$j" ];then
                        i=$((j))
                        break;
                fi
        fi
        i=$((i+1))
done
if [ "$i" = "$total_to_keep" ] ;then
        i=0
fi

slot="$i"
cp "$final_db" "$final_db$i"

function collect_sample()
{
        lsof | awk '{if ($5=="REG") {if (match($9,".so") || match($9,".conf") \
        || match($9,"/bin/") || match($9,"ttf") || match($9,"libexec")) \
        print $9}}' | sort | uniq >> $1
}

collect_sample /tmp/init_sample1

i=0 
while [ "$i" -ne "$total_samples_per_boot" ] ; do
        collect_sample /tmp/init_sample2
        cat /tmp/init_sample1 /tmp/init_sample2 | sort | uniq > /tmp/init_sample3
        mv /tmp/init_sample3 /tmp/init_sample1
        sleep 1
        i=$((i+1))
done

cat /tmp/init_sample1 "$final_db$slot" | sort | uniq > "$final_db"

rm -f /tmp/init_sample[123]
And then do this:
Code:
chmod +x /usr/sbin/sample-init-process
rc-update add my-readahead default
touch /forcesampler

What you have done is asked my-readahead to create a sampler process which samples what files (fonts, binaries, libraries, configs) are in use, every second. It collects 200 samples (will be busy for at least 10 minutes after boot) and keeps updating the database with a list of useful files.

Once you boot after this the first time, you will probably see a slow down because its collecting samples for use on the next and subsequent boots. Use your system as you normally would. Open firefox, gaim, OO or whatever. Once the sampler script has finished ('ps -aef|grep sample-init-process' will tell you if its running), reboot. Now this and all subsequent boots will be much faster.

If it takes too long for the sample-init-process to finish, reduce the total_samples_per_boot variable in the sampler script to 100 and try again by touching /forcesampler.

In future, whenever you feel like updating the prefetch database, just 'touch /forcesampler' and database will be updated on next reboot.

based on http://forums.gentoo.org/viewtopic-t-478491.html, some script modifications done.

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-05-25
2026-05-24
akonadi-config - 1
Ebuild name:

kde-apps/akonadi-config-1

Description

Default Akonadi storage backend configuration

Added to portage

2026-05-24

bazelisk - 1.29.0
Ebuild name:

dev-build/bazelisk-1.29.0

Description

A user-friendly launcher for Bazel written in Go

Added to portage

2026-05-24

blessed - 1.44.0
Ebuild name:

dev-python/blessed-1.44.0

Description

Library for making terminal apps using colors, keyboard input and positio

Added to portage

2026-05-24

chrome-binary-plugins - 148.0.7778.178
Ebuild name:

www-plugins/chrome-binary-plugins-148.0.7778.178

Description

Binary plugins from Google Chrome for use in Chrom

Added to portage

2026-05-24

chrome-binary-plugins - 149.0.7827.22_beta
Ebuild name:

www-plugins/chrome-binary-plugins-149.0.7827.22_beta

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-05-24

chrome-binary-plugins - 150.0.7846.4_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-150.0.7846.4_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-05-24

chromedriver-bin - 148.0.7778.178
Ebuild name:

www-apps/chromedriver-bin-148.0.7778.178

Description

WebDriver for Chrome

Added to portage

2026-05-24

chromium - 148.0.7778.178
Ebuild name:

www-client/chromium-148.0.7778.178

Description

Open-source version of Google Chrome web browser

Added to portage

2026-05-24

chromium - 149.0.7827.22
Ebuild name:

www-client/chromium-149.0.7827.22

Description

Open-source version of Google Chrome web browser

Added to portage

2026-05-24

chromium - 150.0.7846.4
Ebuild name:

www-client/chromium-150.0.7846.4

Description

Open-source version of Google Chrome web browser

Added to portage

2026-05-24

closure-compiler-bin - 20260520
Ebuild name:

dev-lang/closure-compiler-bin-20260520

Description

JavaScript optimizing compiler

Added to portage

2026-05-24

cython - 3.2.5
Ebuild name:

dev-python/cython-3.2.5

Description

A Python to C compiler

Added to portage

2026-05-24

dbus-fast - 5.0.4
Ebuild name:

dev-python/dbus-fast-5.0.4

Description

A faster version of dbus-next

Added to portage

2026-05-24

dist-kernel - 5.10.257
Ebuild name:

virtual/dist-kernel-5.10.257

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-24

dist-kernel - 5.15.208
Ebuild name:

virtual/dist-kernel-5.15.208

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-24

dist-kernel - 6.1.174
Ebuild name:

virtual/dist-kernel-6.1.174

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-24

dist-kernel - 6.12.91
Ebuild name:

virtual/dist-kernel-6.12.91

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-24

dist-kernel - 6.18.33
Ebuild name:

virtual/dist-kernel-6.18.33

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-24

dist-kernel - 6.6.141
Ebuild name:

virtual/dist-kernel-6.6.141

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-24

dist-kernel - 7.0.10
Ebuild name:

virtual/dist-kernel-7.0.10

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-05-24

duration - 0.3.1
Ebuild name:

dev-ml/duration-0.3.1

Description

Duration - conversions to various time units

Added to portage

2026-05-24

firefox - 140.11.0
Ebuild name:

www-client/firefox-140.11.0

Description

Firefox Web Browser

Added to portage

2026-05-24

gcc - 13.4.1_p20260520
Ebuild name:

sys-devel/gcc-13.4.1_p20260520

Description

The GNU Compiler Collection

Added to portage

2026-05-24

gcc - 14.3.1_p20260521
Ebuild name:

sys-devel/gcc-14.3.1_p20260521

Description

The GNU Compiler Collection

Added to portage

2026-05-24

gcc - 15.2.1_p20260522
Ebuild name:

sys-devel/gcc-15.2.1_p20260522

Description

The GNU Compiler Collection

Added to portage

2026-05-24

gcc - 16.1.1_p20260523
Ebuild name:

sys-devel/gcc-16.1.1_p20260523

Description

The GNU Compiler Collection

Added to portage

2026-05-24

gentoo-kernel - 5.10.257
Ebuild name:

sys-kernel/gentoo-kernel-5.10.257

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 5.15.208
Ebuild name:

sys-kernel/gentoo-kernel-5.15.208

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.1.174
Ebuild name:

sys-kernel/gentoo-kernel-6.1.174

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.12.91
Ebuild name:

sys-kernel/gentoo-kernel-6.12.91

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.18.33
Ebuild name:

sys-kernel/gentoo-kernel-6.18.33

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 6.6.141
Ebuild name:

sys-kernel/gentoo-kernel-6.6.141

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel - 7.0.10
Ebuild name:

sys-kernel/gentoo-kernel-7.0.10

Description

Linux kernel built with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 5.10.257
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.10.257

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 5.15.208
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.15.208

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.1.174
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.174

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.12.91
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.91

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.18.33
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.33

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 6.6.141
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.141

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-kernel-bin - 7.0.10
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.0.10

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-05-24

gentoo-sources - 5.10.257
Ebuild name:

sys-kernel/gentoo-sources-5.10.257

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 5.15.208
Ebuild name:

sys-kernel/gentoo-sources-5.15.208

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.1.174
Ebuild name:

sys-kernel/gentoo-sources-6.1.174

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.12.91
Ebuild name:

sys-kernel/gentoo-sources-6.12.91

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.18.33
Ebuild name:

sys-kernel/gentoo-sources-6.18.33

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 6.6.141
Ebuild name:

sys-kernel/gentoo-sources-6.6.141

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gentoo-sources - 7.0.10
Ebuild name:

sys-kernel/gentoo-sources-7.0.10

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-05-24

gjs - 1.88.0-r1
Ebuild name:

dev-libs/gjs-1.88.0-r1

Description

Javascript bindings for GNOME

Added to portage

2026-05-24

gnome-remote-desktop - 49.3-r1
Ebuild name:

net-misc/gnome-remote-desktop-49.3-r1

Description

Remote desktop server which allows you to connect to your mac

Added to portage

2026-05-24

gns3-gui - 2.2.59
Ebuild name:

net-misc/gns3-gui-2.2.59

Description

Graphical Network Simulator

Added to portage

2026-05-24

gns3-server - 2.2.59
Ebuild name:

net-misc/gns3-server-2.2.59

Description

GNS3 server to asynchronously manage emulators

Added to portage

2026-05-24

goffice - 0.10.61-r1
Ebuild name:

x11-libs/goffice-0.10.61-r1

Description

A library of document-centric objects and utilities

Added to portage

2026-05-24

google-chrome - 148.0.7778.178
Ebuild name:

www-client/google-chrome-148.0.7778.178

Description

The web browser from Google

Added to portage

2026-05-24

google-chrome-beta - 149.0.7827.22
Ebuild name:

www-client/google-chrome-beta-149.0.7827.22

Description

The web browser from Google

Added to portage

2026-05-24

google-chrome-unstable - 150.0.7846.4
Ebuild name:

www-client/google-chrome-unstable-150.0.7846.4

Description

The web browser from Google

Added to portage

2026-05-24

lambda-term - 3.4.0
Ebuild name:

dev-ml/lambda-term-3.4.0

Description

Terminal manipulation library for OCaml

Added to portage

2026-05-24

libtmux - 0.58.0
Ebuild name:

dev-python/libtmux-0.58.0

Description

Typed library that provides an ORM wrapper for tmux, a terminal multiplex

Added to portage

2026-05-24

microsoft-edge - 148.0.3967.83
Ebuild name:

www-client/microsoft-edge-148.0.3967.83

Description

The web browser from Microsoft

Added to portage

2026-05-24

microsoft-edge-beta - 149.0.4022.16
Ebuild name:

www-client/microsoft-edge-beta-149.0.4022.16

Description

The web browser from Microsoft

Added to portage

2026-05-24

microsoft-edge-beta - 149.0.4022.24
Ebuild name:

www-client/microsoft-edge-beta-149.0.4022.24

Description

The web browser from Microsoft

Added to portage

2026-05-24

microsoft-edge-dev - 150.0.4041.0
Ebuild name:

www-client/microsoft-edge-dev-150.0.4041.0

Description

The web browser from Microsoft

Added to portage

2026-05-24

modus-themes - 5.2.0
Ebuild name:

app-emacs/modus-themes-5.2.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-05-24

modus-themes - 9999
Ebuild name:

app-emacs/modus-themes-9999

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-05-24

mpg123-el - 1.65
Ebuild name:

app-emacs/mpg123-el-1.65

Description

Emacs front-end to mpg123 audio player and OggVorbis audio player

Added to portage

2026-05-24

mu-cite - 8.1_p202011031127
Ebuild name:

app-emacs/mu-cite-8.1_p202011031127

Description

Message citation utilities for emacsen

Added to portage

2026-05-24

nim - 2.2.10
Ebuild name:

dev-lang/nim-2.2.10

Description

Compiled, garbage-collected systems programming language

Added to portage

2026-05-24

nvc - 1.21.0
Ebuild name:

sci-electronics/nvc-1.21.0

Description

NVC is a VHDL compiler and simulator

Added to portage

2026-05-24

openrazer - 3.12.3
Ebuild name:

sys-apps/openrazer-3.12.3

Description

Drivers and user-space daemon to control Razer devices on GNU/Linux

Added to portage

2026-05-24

opera - 131.0.5877.97
Ebuild name:

www-client/opera-131.0.5877.97

Description

A fast and secure web browser

Added to portage

2026-05-24

opera-developer - 132.0.5903.0
Ebuild name:

www-client/opera-developer-132.0.5903.0

Description

A fast and secure web browser

Added to portage

2026-05-24

phonenumbers - 9.0.31
Ebuild name:

dev-python/phonenumbers-9.0.31

Description

Python port of Google's libphonenumber

Added to portage

2026-05-24

poetry-core - 2.4.1
Ebuild name:

dev-python/poetry-core-2.4.1

Description

Poetry PEP 517 Build Backend

Added to portage

2026-05-24

pwsh - 7.6.2
Ebuild name:

app-shells/pwsh-7.6.2

Description

Cross-platform automation and configuration tool

Added to portage

2026-05-24

pwsh-bin - 7.6.2
Ebuild name:

app-shells/pwsh-bin-7.6.2

Description

Cross-platform automation and configuration tool (binary package)

Added to portage

2026-05-24

rclone - 1.74.2
Ebuild name:

net-misc/rclone-1.74.2

Description

A program to sync files to and from various cloud storage providers

Added to portage

2026-05-24

rhythmbox - 3.4.9-r2
Ebuild name:

media-sound/rhythmbox-3.4.9-r2

Description

Music management and playback software for GNOME

Added to portage

2026-05-24

sdbus-c++ - 2.3.1
Ebuild name:

dev-cpp/sdbus-c++-2.3.1

Description

High-level C++ D-Bus library

Added to portage

2026-05-24

selint - 1.5.1
Ebuild name:

app-admin/selint-1.5.1

Description

Static code analysis of refpolicy style SELinux policy

Added to portage

2026-05-24

selinux-needrestart - 2.20250618_p1
Ebuild name:

sec-policy/selinux-needrestart-2.20250618_p1

Description

SELinux policy for needrestart

Added to portage

2026-05-24

selinux-needrestart - 2.20260312_p1
Ebuild name:

sec-policy/selinux-needrestart-2.20260312_p1

Description

SELinux policy for needrestart

Added to portage

2026-05-24

selinux-needrestart - 9999
Ebuild name:

sec-policy/selinux-needrestart-9999

Description

SELinux policy for needrestart

Added to portage

2026-05-24

selinux-tpm2 - 2.20250618_p1
Ebuild name:

sec-policy/selinux-tpm2-2.20250618_p1

Description

SELinux policy for tpm2

Added to portage

2026-05-24

selinux-tpm2 - 2.20260312_p1
Ebuild name:

sec-policy/selinux-tpm2-2.20260312_p1

Description

SELinux policy for tpm2

Added to portage

2026-05-24

selinux-tpm2 - 9999
Ebuild name:

sec-policy/selinux-tpm2-9999

Description

SELinux policy for tpm2

Added to portage

2026-05-24

starlette - 1.1.0
Ebuild name:

dev-python/starlette-1.1.0

Description

The little ASGI framework that shines

Added to portage

2026-05-24

tea - 0.14.1
Ebuild name:

dev-util/tea-0.14.1

Description

Command line tool to interact with Gitea server

Added to portage

2026-05-24

testfixtures - 12.0.0
Ebuild name:

dev-python/testfixtures-12.0.0

Description

A collection of helpers and mock objects for unit tests and doc test

Added to portage

2026-05-24

utop - 2.17.0
Ebuild name:

dev-ml/utop-2.17.0

Description

Universal toplevel for OCaml

Added to portage

2026-05-24

vanilla-kernel - 5.10.257
Ebuild name:

sys-kernel/vanilla-kernel-5.10.257

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 5.15.208
Ebuild name:

sys-kernel/vanilla-kernel-5.15.208

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 6.1.174
Ebuild name:

sys-kernel/vanilla-kernel-6.1.174

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 6.12.91
Ebuild name:

sys-kernel/vanilla-kernel-6.12.91

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 6.18.33
Ebuild name:

sys-kernel/vanilla-kernel-6.18.33

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 6.6.141
Ebuild name:

sys-kernel/vanilla-kernel-6.6.141

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-kernel - 7.0.10
Ebuild name:

sys-kernel/vanilla-kernel-7.0.10

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-05-24

vanilla-sources - 5.10.257
Ebuild name:

sys-kernel/vanilla-sources-5.10.257

Description

Full sources for the Linux kernel

Added to portage

2026-05-24

vanilla-sources - 5.15.208
Ebuild name:

sys-kernel/vanilla-sources-5.15.208

Description

Full sources for the Linux kernel

Added to portage

2026-05-24

vanilla-sources - 6.1.174
Ebuild name:

sys-kernel/vanilla-sources-6.1.174

Description

Full sources for the Linux kernel

Added to portage

2026-05-24

vanilla-sources - 6.12.91
Ebuild name:

sys-kernel/vanilla-sources-6.12.91

Description

Full sources for the Linux kernel

Added to portage

2026-05-24

vanilla-sources - 6.18.33
Ebuild name:

sys-kernel/vanilla-sources-6.18.33

Description

Full sources for the Linux kernel

Added to portage

2026-05-24

vanilla-sources - 6.6.141
Ebuild name:

sys-kernel/vanilla-sources-6.6.141

Description

Full sources for the Linux kernel

Added to portage

2026-05-24

vanilla-sources - 7.0.10
Ebuild name:

sys-kernel/vanilla-sources-7.0.10

Description

Full sources for the Linux kernel

Added to portage

2026-05-24

vivaldi - 8.0.4033.26
Ebuild name:

www-client/vivaldi-8.0.4033.26

Description

A browser for our friends

Added to portage

2026-05-24

vivaldi - 8.0.4033.28
Ebuild name:

www-client/vivaldi-8.0.4033.28

Description

A browser for our friends

Added to portage

2026-05-24

xwaylandvideobridge - 0.5.0
Ebuild name:

gui-apps/xwaylandvideobridge-0.5.0

Description

Screenshare Wayland windows to XWayland apps

Added to portage

2026-05-24

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 57.9 ms