Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

445. Diagnostics

This page is for finding out what is wrong with a KDOS machine, or simply what it is running. KDOS ships its own diagnostic commands beside the usual process and log tools:

Where each kind of log is written, and how to read it, is a separate page: Logs. Each command is described in full in The kdos command.

Installation

Port Provides
kdos-tools kdos, whose diagnostic subcommands are status, version, doctor, why, explain, oracle, restarts, cve, appid and hey; the reasons corpus under /usr/share/kdos/reasons; the vulnerability database /usr/share/kdos/secdb.txt and the list of bundled libraries /usr/share/kdos/bundled.txt
plasma-systemmonitor, ksystemstats, ksystemstats-kdos System Monitor, its sensor daemon, and the KDOS sensors
kwin supportInformation, and the window list kdos hey and kdos appid ask for
btop, htop, bottom, procs, iotop, nvtop Terminal process, I/O and GPU monitors
lsof, strace Open files, and system calls, of a running process
util-linux dmesg, lsblk, findmnt
fastfetch A one-screen summary of the machine, which the login banner also uses

kpkg check is part of kpkg itself, which is not a port: the bootstrap step that builds it is described in kpkg, and the command in kpkg.

Every port above is on the installation image except btop, bottom, procs, iotop, nvtop and strace, which sudo kdos update install <port> adds (see Installing software); the development group installs strace with the debuggers. No service runs for any of them. kdos is installed as /usr/local/bin/kdos, a link to /usr/sbin/ksvc, the program that also answers as service and several other kdos-* commands.

Configuration

/usr/share/kdos/reasons

kdos why, kdos explain and kdos oracle read a collection of short documents, the reasons, each stating one rule of the system and what breaks if it changes. The kdos-tools port installs it, with the vulnerability database, from src/system/kdos-tools/build.sh:

install -d "$PKG/usr/share/kdos/reasons"
install -m644 "$PORT_SRC"/reasons/*.txt "$PKG/usr/share/kdos/reasons/"

install -Dm644 "$PORT_SRC/secdb/secdb.txt" "$PKG/usr/share/kdos/secdb.txt"
install -Dm644 "$PORT_SRC/secdb/bundled.txt" "$PKG/usr/share/kdos/bundled.txt"

src/system/kdos-tools/build.sh, lines 53–57

Each document begins with a header. One from src/system/kdos-tools/reasons/:

title: one session bus at $XDG_RUNTIME_DIR/bus, never dbus-run-session
path: /etc/kdos/user-services/10_dbus.sh
port: dbus

src/system/kdos-tools/reasons/session-bus-fixed-path.txt, lines 1–4

path: and port: are what kdos why matches. Three variables point the commands elsewhere:

Variable Replaces
KDOS_REASONS /usr/share/kdos/reasons
KDOS_SECDB /usr/share/kdos/secdb.txt
KDOS_BUNDLED /usr/share/kdos/bundled.txt

KWin’s own state

qdbus6 org.kde.KWin /KWin supportInformation prints the compositor’s version, renderer, options, loaded effects and outputs; Debugging lists the rest of what KWin answers on the session bus.

System Monitor’s KDOS sensors

The kdos sensors (boxes, energy by application, the slots) come from the ksystemstats-kdos plugin; they are listed in System Monitor.

Usage

A first look at a machine

  1. Say what the machine is and what it runs:

    kdos version
    kdos status
  2. Check it for KDOS’s known faults:

    kdos doctor

    The lines are grouped under Kernel, Hardware, Boxes, Boot, Session, Services, Containers and Desktop. Each line is one of:

    • [ ok ]: the check passed;
    • [warn]: something is wrong, followed by the fix where there is one;
    • [skip]: the check could not answer here, with the reason.

    The exit status is 1 when anything warned. On the live medium that is always the case: its Boxes section warns that $HOME is on overlayfs (a live session), so a persistent box cannot exist.

  3. Run it as root as well, for the checks only root can make. The Security section, which says whether the kdos password is still the shipped one, appears only when /etc/shadow is readable. The Containers section warns under root, because boxes are meant to run as the desktop account, so ignore those warnings in a root run.

    sudo kdos doctor

Run kdos doctor in a terminal inside the desktop for the Session and Desktop sections to mean anything; from tty2 or SSH they report a missing session.

Doctor’s answer in a script

kdos doctor --json | grep '"warn"'
kdos doctor >/dev/null || echo "kdos doctor found something"

--json prints one record per check line, such as {"section": "Boxes", "level": "warn", "message": "..."}, with the same exit status.

What owns a file, and why it is that way

  1. Ask about a path:

    kdos why /etc/fonts/conf.d/56-noto-preferred.conf

    It prints the package, its version and its recipe, then every reason that names the path or a directory above it. none — provided by fs/ or 10_bootstrap, or not installed means one of three things: the file came from the base filesystem tree, it is kpkg or kinstall (which the first build phase, 10_bootstrap, compiles outside any package), or no package installed it at all.

  2. Ask about a port by name:

    kdos why dbus
  3. Search the reasons for a word:

    kdos explain              # every title
    kdos explain portal       # every reason that mentions it

    Each title is followed, on the next line, by the reason’s file name in brackets, such as (session-bus-fixed-path); with a word, each reason’s text follows its title. A word no reason contains prints nothing recorded about '<word>', and a path or port that kdos why finds in no reason gets no recorded reason.

After an upgrade

kdos restarts

It lists each running process that still uses a library or program an upgrade replaced, with the packages concerned. Restart each one, or log out and back in for the desktop’s own programs. A process still running a program that was removed, not replaced, is listed with removed, no newer version: closing it is all there is to do.

Exit status 0, with Nothing is running deleted code., means nothing is running old code; exit status 1 means something is. A process whose memory map you cannot read is skipped, so run sudo kdos restarts to cover the system services and every other account’s processes.

Checking the installed files

kpkg check pipewire
sudo kpkg check --all

Each finding is a line such as pipewire: changed <path>, and the last line counts them: 1 package checked: 0 missing, 0 changed, 0 mode, 0 config. The exit status is 1 when anything is missing, changed or has the wrong mode, and 2 for a package that is not installed.

Two kinds of line are not faults:

--all reads every installed file, which takes about ten minutes on the live medium. The format is in Checking an installed root.

Known vulnerabilities

kdos cve
kdos cve openssl
kdos doctor --cve

The comparison is offline, against the database shipped with the image (Alpine’s security database). The report’s first line gives the database’s date and age, as in Alpine secdb of 2026-08-12 (<n> days old), and a warning under the summary flags a database more than 180 days old.

A package the database does not carry is reported as unknown, never as clean, and the summary line counts each kind: <n> checked, <n> not in the database, <n> behind a recorded fix. kdos doctor --cve prints the same report as kdos cve. The exit status is 1 when any package is behind a recorded fix.

A desktop that hiccups

KWin’s Show FPS effect (System Settings → Desktop Effects) draws the frame rate and each frame’s paint time on the screen; turn it on, use the machine until the hiccup happens again, and read which frames were late. top or System Monitor at the same time shows what was busy. A static screen produces no frames, so start something that moves before waiting for a hiccup.

Windows and launchers

kdos hey list
kdos hey outputs
kdos appid

Each of these asks KWin:

Command Prints or does
kdos hey list Each window’s application id, box and title
kdos hey boxes The boxes that have a window open
kdos hey outputs Each screen’s name, size, scale and position
kdos hey run <action> <id> Closes, activates, minimises, maximises or otherwise acts on one window
kdos appid Every open window: its application id, OK or MISMATCH, and its title, separated by tabs

A MISMATCH from kdos appid is a window whose application id names no installed desktop entry; the Task Manager shows it as a second, unnamed icon beside the launcher it came from. Both commands exit 2 when there is no session to ask.

Processes and resources

  1. Open System Monitor from the application menu, or run plasma-systemmonitor. On tty2 or over SSH, run btop.
  2. The Processes page lists everything; the KDOS page shows each box’s processor, memory and disk use, energy by application and the two system slots. Its sensors are described in System Monitor.

btop, htop and the others above work in any terminal. sudo iotop shows which process holds the disk.

Tips

Troubleshooting

kdos doctor warns WAYLAND_DISPLAY=… but … does not exist. The shell inherited the variable from a session that has ended. The KWin it names is gone; see Desktop troubleshooting.

kdos hey or kdos appid exits 2. There is no session to ask: the command ran outside the desktop, from a shell with no WAYLAND_DISPLAY and no session bus. Run it in Konsole, or from a login of the same user, which shares the session bus.

kdos explain prints no reasons installed and exits 1, and kdos why finds no reason for anything. No reasons are installed at /usr/share/kdos/reasons, or KDOS_REASONS points at an empty directory. kpkg check kdos-tools shows whether the files are missing.

kdos cve exits 2. /usr/share/kdos/secdb.txt is missing, or KDOS_SECDB names a file that is not there; the message is kdos: no security database at <path>.

System Monitor cannot end or renice a process another account owns. Its helper asks polkit for an administrator’s password, which the session’s agent asks for in a dialog; an account that cannot give one cannot act on another account’s process, and an administrator can also use sudo kill or sudo renice from a terminal. See System Monitor.

lsblk shows no filesystem type, label or UUID. Those columns are filled for root only; run sudo lsblk -f.

Known gaps

See also