354.14. kwrited-6.8.2
KDE write daemon — shows messages sent with write and wall as desktop notifications
6.8.2-1 · CC0-1.0 AND GPL-2.0-or-later · 0.1 SBU · 88.9 KiB, 5 files · 50_desktop, 37 of 92 · ports/core/kde/kwrited
Homepage: https://invent.kde.org/plasma/kwrited
Why it is in KDOS. The comment above it in script/phases/50_desktop/packages.txt:
Shows messages sent with write and wall as notifications.
kwrited receives the messages write and wall send to a user and shows each one as a desktop notification. It opens a pseudo-terminal and registers it in utmp as one of the user’s logins, so that a program writing to every terminal of that user writes to it too; Plasma starts it from the XDG autostart entry kwrited-autostart.desktop, which asks for startup phase 1 (X-KDE-autostart-phase=1).
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, kcoreaddons, ki18n, knotifications, kpty.
Required by (1): kde-plasma.
Sources: kwrited-6.8.2.tar.xz (23.0 KiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/50_desktop/phase.env && kpkg install kwrited'
build.sh:
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D KDE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D BUILD_TESTING=OFF \
-D KF_SKIP_PO_PROCESSING=ON \
-D BUILD_AS_EXECUTABLE=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
chmod u-s,g-s "$PKG/usr/bin/kwrited"
-D KF_SKIP_PO_PROCESSING=ON— Compile none of the interface translation catalogues inpo/. kpkg removes every non-English catalogue from the package anyway (see size and language policy), so this only saves build time.-D BUILD_AS_EXECUTABLE=ON— Build kwrited as the program/usr/bin/kwritedrather than as a kded module. The configure forces this whenever kpty lacks libutempter, as thekptyport does; naming it keeps the package the same shape when the kpty it builds against has utempter, where the default is the module. See Notes.-Wno-dev— Silences CMake’s warnings meant for the project’s own developers.
Programs: kwrited.
Directories: /usr/share/licenses/kwrited.
With libutempter, kpty registers a terminal through utempter’s helper and kwrited can be a kded module. The kpty port is built without utempter, so kwrited is a program of its own, /usr/bin/kwrited, which upstream’s install makes setuid root (chown root, chmod u+s) so that it can write its utmp entry. build.sh clears the setuid and setgid bits after the install. kpty writes that entry with the C library’s pututxline(), which in musl does nothing, so the bit would make kwrited a setuid-root program and register nothing.
The result is that kwrited runs and receives no message: wall from util-linux reads the utmp records through utmps, and kwrited’s terminal is not among them. kwrited can receive messages once kpty writes its records through utmps; utmps-utmpd accepts a record only from root or from a client running with the daemon’s own group, so kwrited then needs its setuid bit, or a setgid bit for that group, and the list of setuid binaries names it.