Skip to content

bootwhy is a small command-line tool for Linux that helps you understand why your system boots slowly. It inspects boot performance data (for example from `systemd-analyze` and system logs), highlights the slowest services and phases, and prints a concise summary so you can see which components are responsible for most of the boot time.

License

Notifications You must be signed in to change notification settings

Ninso112/bootwhy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bootwhy

bootwhy is a small command-line tool for Linux that helps you understand why your system boots slowly. It inspects boot performance data (for example from systemd-analyze and system logs), highlights the slowest services and phases, and prints a concise summary so you can see which components are responsible for most of the boot time.

Installation

Using pip

Install bootwhy from the project directory:

pip install .

After installation, the bootwhy command will be available in your PATH.

Running without installation

You can also run bootwhy directly without installation:

python -m bootwhy

Note: Make sure you have the src directory in your Python path, or run from the project root.

Usage

Default behavior

Run bootwhy without any arguments to see a summary of boot time and the top 5 slowest services:

bootwhy

Example output:

Total boot time: 12.345s
  Kernel: 2.100s
  Userspace: 10.245s

Top 5 slowest services:

   1. NetworkManager-wait-online.service                     5.123s
   2. systemd-udev-settle.service                            2.456s
   3. plymouth-quit-wait.service                             1.234s
   4. systemd-journal-flush.service                          0.890s
   5. systemd-tmpfiles-setup.service                         0.567s

Show top N services

Use --top N to display a different number of slowest services:

bootwhy --top 10

Show summary only

Use --summary (or -s) to show only the boot time summary and the top 3 slowest services:

bootwhy --summary

Show critical chain

Use --critical-chain (or -c) to display the critical chain analysis:

bootwhy --critical-chain

This shows the dependency chain of the slowest services during boot, formatted by systemd-analyze.

Show raw data

Use --raw to display all collected data in JSON format:

bootwhy --raw

Show version

Use --version (or -V) to display the version number:

bootwhy --version

Show help

Use --help (or -h) to display the help message:

bootwhy --help

Command-line Options

Option Short Description
--help -h Show help message and exit
--version -V Show version number and exit
--summary -s Show only boot time summary and top 3 services
--top N Number of top slowest services to display (default: 5)
--critical-chain -c Show critical chain analysis
--raw Show raw data in JSON format

Limitations

systemd dependency

bootwhy requires systemd-analyze to be available on your system. It is designed to work with Linux distributions that use systemd as their init system.

If you run bootwhy on a system without systemd or without systemd-analyze installed, you will see a clear error message:

bootwhy: error: bootwhy requires systemd-analyze. Please install systemd or run on a systemd-based distribution.

Permissions

Some systemd-analyze commands may require certain permissions to access boot data. If you encounter permission errors, try running bootwhy with appropriate privileges (e.g., using sudo if necessary, though this is typically not required for reading boot performance data).

Non-systemd systems

bootwhy currently does not support non-systemd init systems. On systems without systemd, the tool will gracefully exit with an error message.

Requirements

  • Python 3.7 or higher
  • Linux system with systemd and systemd-analyze command
  • Standard Python library only (no external dependencies)

License

This project is licensed under the GNU General Public License v3.0 (GPLv3).

See the LICENSE file for the full license text.

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

About

bootwhy is a small command-line tool for Linux that helps you understand why your system boots slowly. It inspects boot performance data (for example from `systemd-analyze` and system logs), highlights the slowest services and phases, and prints a concise summary so you can see which components are responsible for most of the boot time.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages