Skip to content

Fix utmp issue 2252 - #2425

Open
Komal-ai417 wants to merge 2 commits into
brndnmtthws:mainfrom
Komal-ai417:fix-utmp-issue-2252
Open

Fix utmp issue 2252#2425
Komal-ai417 wants to merge 2 commits into
brndnmtthws:mainfrom
Komal-ai417:fix-utmp-issue-2252

Conversation

@Komal-ai417

Copy link
Copy Markdown

Resolves #2252.

Description:
As systemd phases out utmp support (and distributions like Ubuntu 25.04 drop it entirely to address the Y2K38 problem), the ${user_names} and ${user_terms} variables output "broken".

This PR implements a fallback strategy using systemd-logind APIs for systems where utmp is no longer viable.

Changes:

  • Updated CMakeLists.txt to conditionally check for and link libsystemd.
  • Wrapped legacy getutent() logic in users.cc inside an #ifndef HAVE_SYSTEMD block.
  • Implemented sd_get_sessions() to retrieve active sessions.
  • Used sd_session_get_uid() combined with getpwuid() to safely retrieve usernames to ensure compatibility with older systemd versions (prior to v254).

Added support for systemd user tracking by checking for libsystemd and updating include and library paths accordingly.
@netlify

netlify Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit eb1b5c0
🔍 Latest deploy log https://app.netlify.com/projects/conkyweb/deploys/6a646194a9f2e10007961f6d

@github-actions github-actions Bot added sources PR modifies project sources build system related to build system (CMake) and/or building process/assumptions labels Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build system related to build system (CMake) and/or building process/assumptions sources PR modifies project sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "user_names" show "broken"

1 participant