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:

88700

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-09-26
astroid - 4.3.2
Ebuild name:

dev-python/astroid-4.3.2

Description

Abstract Syntax Tree for logilab packages

Added to portage

2026-09-26

awscli - 2.37.4
Ebuild name:

app-admin/awscli-2.37.4

Description

Universal Command Line Environment for AWS

Added to portage

2026-09-26

bitwarden-desktop-bin - 2026.9.0
Ebuild name:

app-admin/bitwarden-desktop-bin-2026.9.0

Description

Bitwarden password manager desktop client

Added to portage

2026-09-26

boto3 - 1.43.103
Ebuild name:

dev-python/boto3-1.43.103

Description

The AWS SDK for Python

Added to portage

2026-09-26

botocore - 1.43.103
Ebuild name:

dev-python/botocore-1.43.103

Description

Low-level, data-driven core of boto 3

Added to portage

2026-09-26

crash - 9.0.3
Ebuild name:

dev-util/crash-9.0.3

Description

Red Hat crash utility; used for analyzing kernel core dumps

Added to portage

2026-09-26

dbeaver-bin - 26.2.1
Ebuild name:

dev-db/dbeaver-bin-26.2.1

Description

Free universal database tool (community edition)

Added to portage

2026-09-26

dist-kernel - 6.18.54
Ebuild name:

virtual/dist-kernel-6.18.54

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-26

dist-kernel - 7.2.8
Ebuild name:

virtual/dist-kernel-7.2.8

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-26

fcitx - 5.1.23
Ebuild name:

app-i18n/fcitx-5.1.23

Description

Fcitx 5 is a generic input method framework

Added to portage

2026-09-26

fcitx-chinese-addons - 5.1.15
Ebuild name:

app-i18n/fcitx-chinese-addons-5.1.15

Description

Addons related to Chinese, including IME previous bundled insi

Added to portage

2026-09-26

fcitx-configtool - 5.1.16
Ebuild name:

app-i18n/fcitx-configtool-5.1.16

Description

Configuration module for Fcitx

Added to portage

2026-09-26

fcitx-qt - 5.1.16
Ebuild name:

app-i18n/fcitx-qt-5.1.16

Description

Qt library and IM module for fcitx5

Added to portage

2026-09-26

feh - 3.13.1
Ebuild name:

media-gfx/feh-3.13.1

Description

A fast, lightweight imageviewer using imlib2

Added to portage

2026-09-26

gentoo-kernel - 6.18.54
Ebuild name:

sys-kernel/gentoo-kernel-6.18.54

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-26

gentoo-kernel - 7.2.8
Ebuild name:

sys-kernel/gentoo-kernel-7.2.8

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-26

gentoo-kernel-bin - 6.18.54
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.54

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-26

gentoo-kernel-bin - 7.2.8
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.2.8

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-26

gentoo-kernel-modprep - 6.18.54
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.54

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-09-26

gentoo-kernel-modprep - 7.2.8
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.2.8

Description

Minimal subset of gentoo-kernel-bin for building modules, fo

Added to portage

2026-09-26

libime - 1.1.17
Ebuild name:

app-i18n/libime-1.1.17

Description

Fcitx5 Next generation of fcitx

Added to portage

2026-09-26

markdown - 3.11
Ebuild name:

dev-python/markdown-3.11

Description

Python implementation of the markdown markup language

Added to portage

2026-09-26

multipart - 2.0.1
Ebuild name:

dev-python/multipart-2.0.1

Description

Parser for multipart/form-data

Added to portage

2026-09-26

opentelemetry-api - 1.45.0
Ebuild name:

dev-python/opentelemetry-api-1.45.0

Description

OpenTelemetry Python API

Added to portage

2026-09-26

opentelemetry-sdk - 1.45.0
Ebuild name:

dev-python/opentelemetry-sdk-1.45.0

Description

OpenTelemetry Python SDK

Added to portage

2026-09-26

opentelemetry-semantic-conventions - 1.45.0
Ebuild name:

dev-python/opentelemetry-semantic-conventions-1.45.0

Description

OpenTelemetry Semantic Conventions

Added to portage

2026-09-26

platformdirs - 4.11.14
Ebuild name:

dev-python/platformdirs-4.11.14

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-09-26

platformdirs - 4.11.15
Ebuild name:

dev-python/platformdirs-4.11.15

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-09-26

pydata-sphinx-theme - 0.22.0
Ebuild name:

dev-python/pydata-sphinx-theme-0.22.0

Description

Bootstrap-based Sphinx theme from the PyData community

Added to portage

2026-09-26

pykwalify - 1.8.0-r4
Ebuild name:

dev-python/pykwalify-1.8.0-r4

Description

Python lib/cli for JSON/YAML schema validation

Added to portage

2026-09-26

pypy - 3.12.8.0.0
Ebuild name:

dev-lang/pypy-3.12.8.0.0

Description

A fast, compliant alternative implementation of the Python () language

Added to portage

2026-09-26

pypy3-exe - 3.12.8.0.0
Ebuild name:

dev-lang/pypy3-exe-3.12.8.0.0

Description

PyPy3.12 executable (build from source)

Added to portage

2026-09-26

pypy3-exe-bin - 3.12.8.0.0
Ebuild name:

dev-lang/pypy3-exe-bin-3.12.8.0.0

Description

PyPy executable (pre-built version)

Added to portage

2026-09-26

qbittorrent - 5.1.4-r1
Ebuild name:

net-p2p/qbittorrent-5.1.4-r1

Description

BitTorrent client in C++ and Qt

Added to portage

2026-09-26

qbittorrent - 5.2.0-r1
Ebuild name:

net-p2p/qbittorrent-5.2.0-r1

Description

BitTorrent client in C++ and Qt

Added to portage

2026-09-26

qbittorrent - 5.2.3
Ebuild name:

net-p2p/qbittorrent-5.2.3

Description

BitTorrent client in C++ and Qt

Added to portage

2026-09-26

raspberrypi-firmware - 1.20260915
Ebuild name:

sys-boot/raspberrypi-firmware-1.20260915

Description

Raspberry Pi (all versions) bootloader and GPU firmware

Added to portage

2026-09-26

raspberrypi-image - 6.18.50_p20260915
Ebuild name:

sys-kernel/raspberrypi-image-6.18.50_p20260915

Description

Raspberry Pi (all versions) kernel and modules

Added to portage

2026-09-26

raspberrypi-sources - 6.18.50_p20260915
Ebuild name:

sys-kernel/raspberrypi-sources-6.18.50_p20260915

Description

Raspberry Pi kernel sources

Added to portage

2026-09-26

rime-data - 1.0.20260922
Ebuild name:

app-i18n/rime-data-1.0.20260922

Description

Added to portage

2026-09-26

rpi-eeprom - 28.32
Ebuild name:

dev-embedded/rpi-eeprom-28.32

Description

Updater for Raspberry Pi 4/5 bootloader and the VL805 USB controller

Added to portage

2026-09-26

scikit-build-core - 1.1.0
Ebuild name:

dev-python/scikit-build-core-1.1.0

Description

Build backend for CMake based projects

Added to portage

2026-09-26

sqlalchemy - 2.1.1
Ebuild name:

dev-python/sqlalchemy-2.1.1

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-09-26

stripe-mock - 0.205.0
Ebuild name:

dev-util/stripe-mock-0.205.0

Description

Mock HTTP server that responds like the real Stripe API

Added to portage

2026-09-26

tavern - 3.7.0
Ebuild name:

dev-python/tavern-3.7.0

Description

A tool, library, and Pytest plugin for testing RESTful APIs

Added to portage

2026-09-26

tox - 4.64.3
Ebuild name:

dev-python/tox-4.64.3

Description

virtualenv-based automation of test activities

Added to portage

2026-09-26

uvicorn - 0.54.0
Ebuild name:

dev-python/uvicorn-0.54.0

Description

Lightning-fast ASGI server implementation

Added to portage

2026-09-26

vanilla-kernel - 6.18.54
Ebuild name:

sys-kernel/vanilla-kernel-6.18.54

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-26

vanilla-kernel - 7.2.8
Ebuild name:

sys-kernel/vanilla-kernel-7.2.8

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-26

xdelta - 1.2.0
Ebuild name:

dev-util/xdelta-1.2.0

Description

Computes changes between binary or text files and creates deltas

Added to portage

2026-09-26

2026-09-25
airspy - 1.0.10-r1
Ebuild name:

net-wireless/airspy-1.0.10-r1

Description

Usemode driver and associated tools for airspy

Added to portage

2026-09-25

astyle - 3.6.18
Ebuild name:

dev-util/astyle-3.6.18

Description

Artistic Style is a re-indenter and reformatter for C, C++ and Java source c

Added to portage

2026-09-25

aws-c-common - 1.0.1-r1
Ebuild name:

dev-libs/aws-c-common-1.0.1-r1

Description

Core c99 package for AWS SDK for C

Added to portage

2026-09-25

bindgen - 0.73.2
Ebuild name:

dev-util/bindgen-0.73.2

Description

Automatically generate Rust FFI bindings to C and C++ libraries

Added to portage

2026-09-25

c-blosc2 - 3.3.5
Ebuild name:

dev-libs/c-blosc2-3.3.5

Description

Blocking, shuffling and lossless compression library

Added to portage

2026-09-25

chafa - 1.18.3
Ebuild name:

media-gfx/chafa-1.18.3

Description

versatile and fast Unicode/ASCII/ANSI graphics renderer

Added to portage

2026-09-25

containerd - 2.4.1
Ebuild name:

app-containers/containerd-2.4.1

Description

A daemon to control runC

Added to portage

2026-09-25

cvmfs - 2.14.1
Ebuild name:

net-fs/cvmfs-2.14.1

Description

HTTP read-only file system for distributing software

Added to portage

2026-09-25

difftastic - 0.71.0
Ebuild name:

dev-util/difftastic-0.71.0

Description

A structural diff that understands syntax

Added to portage

2026-09-25

django-js-asset - 4.2.0
Ebuild name:

dev-python/django-js-asset-4.2.0

Description

Script tag with additional attributes for django.forms.Media

Added to portage

2026-09-25

dokuwiki - 20260714c-r1
Ebuild name:

www-apps/dokuwiki-20260714c-r1

Description

DokuWiki is a simple to use Wiki aimed at a small company's document

Added to portage

2026-09-25

fetchmail - 6.6.8
Ebuild name:

net-mail/fetchmail-6.6.8

Description

the legendary remote-mail retrieval and forwarding utility

Added to portage

2026-09-25

gallery-dl - 1.32.13
Ebuild name:

net-misc/gallery-dl-1.32.13

Description

Download image galleries and collections from several image hosting sit

Added to portage

2026-09-25

gentoo-sources - 6.18.54
Ebuild name:

sys-kernel/gentoo-sources-6.18.54

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-09-25

gentoo-sources - 7.2.8
Ebuild name:

sys-kernel/gentoo-sources-7.2.8

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-09-25

ggml - 0.25.3
Ebuild name:

sci-ml/ggml-0.25.3

Description

Tensor library for machine learning

Added to portage

2026-09-25

github-cli - 2.101.0
Ebuild name:

dev-util/github-cli-2.101.0

Description

GitHub CLI

Added to portage

2026-09-25

gitlab-cli - 1.119.0
Ebuild name:

dev-util/gitlab-cli-1.119.0

Description

the official gitlab command line interface

Added to portage

2026-09-25

golangci-lint - 2.14.0
Ebuild name:

dev-go/golangci-lint-2.14.0

Description

Fast linters runner for Go

Added to portage

2026-09-25

google-api-core - 2.39.0
Ebuild name:

dev-python/google-api-core-2.39.0

Description

Core Library for Google Client Libraries

Added to portage

2026-09-25

google-auth - 2.58.1
Ebuild name:

dev-python/google-auth-2.58.1

Description

Google Authentication Library

Added to portage

2026-09-25

googleapis-common-protos - 1.75.4
Ebuild name:

dev-python/googleapis-common-protos-1.75.4

Description

Python classes generated from the common protos in the g

Added to portage

2026-09-25

haproxy - 3.0.28
Ebuild name:

net-proxy/haproxy-3.0.28

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-09-25

haproxy - 3.2.24
Ebuild name:

net-proxy/haproxy-3.2.24

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-09-25

haproxy - 3.4.5
Ebuild name:

net-proxy/haproxy-3.4.5

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-09-25

linode-cli - 5.69.0
Ebuild name:

app-admin/linode-cli-5.69.0

Description

Official command-line interface for interacting with the Linode API

Added to portage

2026-09-25

linode-metadata - 0.4.0
Ebuild name:

dev-python/linode-metadata-0.4.0

Description

Python bindings for the Linode Metadata Service

Added to portage

2026-09-25

magit - 4.7.1
Ebuild name:

app-emacs/magit-4.7.1

Description

A Git porcelain inside Emacs

Added to portage

2026-09-25

netpbm - 11.15.8
Ebuild name:

media-libs/netpbm-11.15.8

Description

A set of utilities for converting to/from the netpbm (and related) format

Added to portage

2026-09-25

netpbm - 11.2.30
Ebuild name:

media-libs/netpbm-11.2.30

Description

A set of utilities for converting to/from the netpbm (and related) format

Added to portage

2026-09-25

ollama - 0.34.4
Ebuild name:

sci-ml/ollama-0.34.4

Description

Get up and running with Llama 3, Mistral, Gemma, and other language models

Added to portage

2026-09-25

openjdk-bin - 27_p35
Ebuild name:

dev-java/openjdk-bin-27_p35

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-25

openjdk-bin - 28_alpha16
Ebuild name:

dev-java/openjdk-bin-28_alpha16

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-25

package-build - 5.0.3
Ebuild name:

app-emacs/package-build-5.0.3

Description

Tools for assembling a package archive

Added to portage

2026-09-25

phonenumbers - 9.0.40
Ebuild name:

dev-python/phonenumbers-9.0.40

Description

Python port of Google's libphonenumber

Added to portage

2026-09-25

prusaslicer - 2.9.6-r1
Ebuild name:

media-gfx/prusaslicer-2.9.6-r1

Description

A mesh slicer to generate G-code for fused-filament-fabrication (3D

Added to portage

2026-09-25

pybugz - 0.15
Ebuild name:

www-client/pybugz-0.15

Description

Command line interface to (Gentoo) Bugzilla

Added to portage

2026-09-25

pycargoebuild - 0.17.1
Ebuild name:

app-portage/pycargoebuild-0.17.1

Description

A generator for Rust/Cargo ebuilds written in Python

Added to portage

2026-09-25

pymongo - 4.18.2
Ebuild name:

dev-python/pymongo-4.18.2

Description

Python driver for MongoDB

Added to portage

2026-09-25

pytz - 2026.4
Ebuild name:

dev-python/pytz-2026.4

Description

World timezone definitions for Python

Added to portage

2026-09-25

ruff - 0.16.9
Ebuild name:

dev-util/ruff-0.16.9

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-09-25

sqlalchemy - 2.1.0
Ebuild name:

dev-python/sqlalchemy-2.1.0

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-09-25

stripe-mock - 0.204.0
Ebuild name:

dev-util/stripe-mock-0.204.0

Description

Mock HTTP server that responds like the real Stripe API

Added to portage

2026-09-25

systemd-utils - 262
Ebuild name:

sys-apps/systemd-utils-262

Description

Utilities split out from systemd for OpenRC users

Added to portage

2026-09-25

tox - 4.64.2
Ebuild name:

dev-python/tox-4.64.2

Description

virtualenv-based automation of test activities

Added to portage

2026-09-25

untangle-https-backup - 0.2.0
Ebuild name:

app-backup/untangle-https-backup-0.2.0

Description

Back up Untangle configurations via the web admin UI

Added to portage

2026-09-25

uv - 0.12.19
Ebuild name:

dev-python/uv-0.12.19

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-09-25

uv-build - 0.12.19
Ebuild name:

dev-python/uv-build-0.12.19

Description

PEP517 uv build backend

Added to portage

2026-09-25

vanilla-sources - 6.18.54
Ebuild name:

sys-kernel/vanilla-sources-6.18.54

Description

Full sources for the Linux kernel

Added to portage

2026-09-25

vanilla-sources - 7.2.8
Ebuild name:

sys-kernel/vanilla-sources-7.2.8

Description

Full sources for the Linux kernel

Added to portage

2026-09-25

vertico - 2.15
Ebuild name:

app-emacs/vertico-2.15

Description

Vertical interactive completion

Added to portage

2026-09-25

virtualenv - 21.12.1
Ebuild name:

dev-python/virtualenv-21.12.1

Description

Virtual Python Environment builder

Added to portage

2026-09-25

ytmusicapi - 1.12.3
Ebuild name:

dev-python/ytmusicapi-1.12.3

Description

Unofficial API for YouTube Music

Added to portage

2026-09-25

zabbix - 6.0.48-r1
Ebuild name:

net-analyzer/zabbix-6.0.48-r1

Description

ZABBIX is software for monitoring of your applications, network and s

Added to portage

2026-09-25

zabbix - 7.0.30-r1
Ebuild name:

net-analyzer/zabbix-7.0.30-r1

Description

ZABBIX is software for monitoring of your applications, network and s

Added to portage

2026-09-25

zabbix - 7.0.31-r1
Ebuild name:

net-analyzer/zabbix-7.0.31-r1

Description

ZABBIX is software for monitoring of your applications, network and s

Added to portage

2026-09-25

zabbix - 7.4.14-r1
Ebuild name:

net-analyzer/zabbix-7.4.14-r1

Description

ZABBIX is software for monitoring of your applications, network and s

Added to portage

2026-09-25

zabbix - 7.4.15-r1
Ebuild name:

net-analyzer/zabbix-7.4.15-r1

Description

ZABBIX is software for monitoring of your applications, network and s

Added to portage

2026-09-25

zedis - 0.11.1
Ebuild name:

dev-db/zedis-0.11.1

Description

Blazing-fast native Redis GUI built with Rust and GPUI

Added to portage

2026-09-25

zsnes - 2.3.2
Ebuild name:

games-emulation/zsnes-2.3.2

Description

Fork of the classic Super Nintendo emulator

Added to portage

2026-09-25

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