79.14. accountsservice-26.27.3
D-Bus service for querying and changing user accounts (org.freedesktop.Accounts)
| Version | 26.27.3, release 1 |
| Shelf | auth — Authentication, authorisation, accounts and directory services |
| Phase | 41_system (System), 188 of 1047 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://www.freedesktop.org/wiki/Software/AccountsService/ |
| Build time | 0.2 SBU |
| Installed size | 661.9 KiB in 18 files |
| Recipe | ports/core/auth/accountsservice/kpkgbuild |
About
AccountsService is the system service that owns org.freedesktop.Accounts on the system bus. It lists the machine’s human accounts and lets a program read and change their properties: real name, avatar, language, account type and password. Its root daemon, accounts-daemon, keeps what /etc/passwd cannot hold in /var/lib/AccountsService/users/<user> and each avatar in /var/lib/AccountsService/icons/<user>; libaccountsservice is the client library.
On KDOS the reason for it is the desktop, not a link: System Settings’ Users page and the portal’s account dialog talk to it over D-Bus, and SDDM shows the avatar it stores at the login screen. It asks polkit before every change: a user may change their own account from the active session, and changing another account needs an administrator. The daemon is /usr/lib/accounts-daemon, started at boot by /etc/init.d/44_accounts.sh under ksvc.
Sources
accountsservice-26.27.3.tar.gz(670.4 KiB)
sha25611de07bcd499c2277f78a6fc830d1437654f3397cc7bbed19c28b3818435ba38
upstream: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/archive/26.27.3/accountsservice-26.27.3.tar.gz
archive copy: sources-1/auth--accountsservice-26.27.3.tar.gz
Dependencies
Depends on: meson, ninja, pkgconf, gettext, glib, json-c, dbus, polkit, elogind.
Required by (1): plasma-workspace.
Patches
build.sh applies these; kpkg applies nothing by itself.
useradd-default-groups.patch makes the daemon create an administrator in two steps, useradd -m -c <name> -- <user> and then usermod -a -G wheel -- <user>, instead of one useradd -G wheel. useradd’s -G replaces the GROUPS= list of /etc/default/useradd rather than adding to it, and that list is how every new account on KDOS joins audio, which carries PipeWire’s real-time limits. Without the patch an account System Settings makes as a Standard user would join audio and one made as an Administrator would not. Changing an account’s type later keeps it: the daemon rewrites the membership with usermod -G, adding or dropping wheel alone, so audio stays. The upstream option -Dextra_admin_groups=audio is not the fix, because the daemon takes those groups away again when an administrator is made Standard. Not proposed upstream: a distribution without GROUPS= sees no difference.
useradd-default-groups.patch— Keep useradd's default groups for a new administrator
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install accountsservice'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/auth/accountsservice.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/auth/accountsservice
echo '11de07bcd499c2277f78a6fc830d1437654f3397cc7bbed19c28b3818435ba38 accountsservice-26.27.3.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/accountsservice
SRC=$SRC_ROOT/accountsservice-26.27.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf accountsservice-26.27.3.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/useradd-default-groups.patch"
meson setup build \
--prefix=/usr --sysconfdir=/etc --libdir=lib \
--libexecdir=/usr/lib \
--buildtype=release \
-Delogind=true \
-Dadmin_group=wheel \
-Dwtmpfile=/var/log/wtmp \
-Dsystemdsystemunitdir=no \
-Dlibxcrypt=false \
-Dintrospection=false \
-Dvapi=false \
-Ddocbook=false \
-Dgtk_doc=false \
-Dtests=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
rm "$PKG/usr/share/dbus-1/system-services/org.freedesktop.Accounts.service"
rmdir "$PKG/usr/share/dbus-1/system-services"
The switches, and why each is set:
--libexecdir=/usr/lib— Install the daemon as/usr/lib/accounts-daemon, the path the init script starts, instead of under/usr/libexec.-Delogind=true— Linklibaccountsserviceagainst elogind’slibelogindinstead oflibsystemd. The client library reads login sessions throughsd-loginto tell which listed users are logged in; the daemon does not link it. The build requires one of the two, and only elogind is a port.-Dadmin_group=wheel— The group that makes an account an administrator, both in what the daemon reports as the account type and in what it changes when System Settings switches a user between Standard and Administrator.wheelis the groupsudoand the polkit rules already treat as administrators on KDOS. Left empty, configure guesses from marker files of other distributions in the build root.-Dwtmpfile=/var/log/wtmp— The login history file the daemon watches to update each account’s last-login time. It is the path utmps writes. Left empty, configure looks forWTMPX_FILENAMEor_PATH_WTMPX, finds neither in musl’s headers, falls back to FreeBSD’s/var/log/utx.logand stops unless that file exists in the build root. The daemon reads the file through the C library’sutmpxfunctions, which on musl are stubs, so last-login times stay empty.-Dsystemdsystemunitdir=no— Install no systemd unit. Left empty, configure stops unless it finds systemd’spkg-configfile.-Dlibxcrypt=false— Hash passwords set through the daemon with the C library’scrypt_r. libxcrypt is not a port; musl’scryptwrites SHA-512 hashes, the same hashespasswdandpam_unixwrite here.-Dintrospection=false,-Dvapi=false— Generate no GObject introspection data and no Vala bindings forlibaccountsservice. Every consumer in the tree reaches the service over D-Bus, and none loads the GIR or compiles against the VAPI.-Ddocbook=false,-Dgtk_doc=false— Build neither the HTML D-Bus interface reference nor the API reference. Upstream has no manual page.-Dtests=false— Build no tests. They need themocklibcsubproject, which meson would try to download.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/accountsservice, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf accountsservice-26.27.3-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/accountsservice, and runs the triggers its paths call for.
Contents
Installed libraries: libaccountsservice.so.
Installed directories: /usr/include/accountsservice-1.0, /usr/share/accountsservice, /usr/share/licenses/accountsservice, /var/lib/AccountsService.
Short descriptions
accountsservice.pc |
Client Library for communicating with accounts service |
Notes
The recipe deletes /usr/share/dbus-1/system-services/org.freedesktop.Accounts.service, the D-Bus activation file the build installs with no option to leave it out. 44_accounts.sh supervises accounts-daemon, and with the file a caller that asked for the name before the supervised daemon held it would make the bus start a second, unsupervised one; whichever lost the name would exit, and a supervised one that lost would be restarted every five seconds without ever getting it.
/var/lib/AccountsService/users must be mode 0700 and icons 0775. The package cannot carry those modes, because kpkgadd creates every directory 0755; accounts-daemon creates and chmods both itself as it starts, and refuses to start if it cannot.
The project’s version comes from generate-version.sh, which outside a git checkout reads it from the name of the source directory, accountsservice-<version>. kpkg unpacks into exactly that name; a build from a directory named otherwise stops at meson setup with “Version unknown”.
gettext is in depends for msgfmt, which merges the polkit policy’s translations; the message catalogues it also installs are removed by the language policy.