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:
kdos doctorchecks for the faults KDOS is known to have;kdos whyandkdos explainsay what owns a file and why it is the way it is;kdos restartslists programs still running old code after an upgrade;kdos cvecompares the installed packages with a database of known vulnerabilities;kdos heyandkdos appidask KWin about the open windows;kpkg checkcompares the installed files with what the packages installed;- KWin’s own report and System Monitor show the desktop and the processes.
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
Say what the machine is and what it runs:
kdos version kdos statusCheck it for KDOS’s known faults:
kdos doctorThe lines are grouped under
Kernel,Hardware,Boxes,Boot,Session,Services,ContainersandDesktop. 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.Run it as root as well, for the checks only root can make. The Security section, which says whether the
kdospassword is still the shipped one, appears only when/etc/shadowis 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
Ask about a path:
kdos why /etc/fonts/conf.d/56-noto-preferred.confIt 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 installedmeans one of three things: the file came from the base filesystem tree, it iskpkgorkinstall(which the first build phase,10_bootstrap, compiles outside any package), or no package installed it at all.Ask about a port by name:
kdos why dbusSearch the reasons for a word:
kdos explain # every title kdos explain portal # every reason that mentions itEach 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 printsnothing recorded about '<word>', and a path or port thatkdos whyfinds in no reason getsno 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:
configlines are files under/etcthat someone edited;unownedlines, printed by--all, are files under/usror/optthat no package claims, such asunowned ./usr/share/xdg-desktop-portal/kdos-portals.conffor a file of the base filesystem.
--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
- Open System Monitor from the application menu, or run
plasma-systemmonitor. Ontty2or over SSH, runbtop. - 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
- Most
kdossubcommands share one exit-status convention: 0 nothing found, 1 something found or failed, 2 used wrongly, 127 the program it hands over to is missing. A subcommand that differs says so in its section of The kdos command. kdos oracleprints one reason and its citation. It stays the same all day and changes after a reboot.kdos doctorchecks the setuid bit on the helpers that need one, and names the repair. A lost bit fails silently everywhere else: the lock screen refuses every password (unix_chkpwd), or no box starts (newuidmap).kdos status --barprints one line of running boxes and exported applications, for a script or a status bar.- A skip from
kdos doctorsays the check could not answer, not that it passed.
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
kdos heyandkdos appidhave been tested only against a simulated session bus, not on a running Plasma desktop; see Status.- kdos doctor cannot check hardware a machine does not have
- lsblk shows a filesystem’s type, label and UUID to root only
- btop’s GPU panel is empty on Intel graphics unless btop runs as root
See also
- Diagnosis and kdos doctor: every diagnostic subcommand
- Vulnerability tracking: how
kdos cvecompares versions - System Monitor: the KDOS sensors and page
- When a boot stops: which file explains each boot stage
- Logs, Services, kpkg, Out of memory, Desktop troubleshooting