Skip to content

Add user to systemd-journal group so journalctl --user works#5050

Merged
jandubois merged 1 commit into
lima-vm:masterfrom
AkihiroSuda:fix-5047
May 31, 2026
Merged

Add user to systemd-journal group so journalctl --user works#5050
jandubois merged 1 commit into
lima-vm:masterfrom
AkihiroSuda:fix-5047

Conversation

@AkihiroSuda

Copy link
Copy Markdown
Member

Adds a boot script that adds the default user to the "systemd-journal" group on systemd-based distributions, so that journalctl --user works out of the box instead of failing with "No journal files were opened due to insufficient permissions".

The "systemd-journal" group only exists on systemd-based distributions, so the script guards on its existence with getent and is a no-op elsewhere (e.g. Alpine).

Fixes #5047


Note: used Claude

@AkihiroSuda AkihiroSuda added this to the v2.1.2 milestone May 26, 2026
@AkihiroSuda
AkihiroSuda requested a review from unsuman May 27, 2026 01:23
@AkihiroSuda AkihiroSuda removed this from the v2.1.2 milestone May 27, 2026
@AkihiroSuda
AkihiroSuda marked this pull request as draft May 27, 2026 08:50
@AkihiroSuda AkihiroSuda added this to the v2.1.2 milestone May 27, 2026
@AkihiroSuda
AkihiroSuda marked this pull request as ready for review May 27, 2026 09:02
unsuman
unsuman previously approved these changes May 27, 2026

@unsuman unsuman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AkihiroSuda
AkihiroSuda requested a review from afbjorklund May 28, 2026 00:04
Comment thread pkg/cidata/cidata.TEMPLATE.d/boot.Linux/00-systemd-user-group.sh
Adds a boot script that adds the default user to the "systemd-journal"
group on systemd-based distributions, so that `journalctl --user` works
out of the box instead of failing with "No journal files were opened due
to insufficient permissions".

The "systemd-journal" group only exists on systemd-based distributions,
so the script guards on its existence with getent and is a no-op
elsewhere (e.g. Alpine).

Fixes lima-vm#5047

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>

@jandubois jandubois left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@jandubois jandubois closed this May 30, 2026
@jandubois jandubois reopened this May 30, 2026
@jandubois
jandubois merged commit 2255df1 into lima-vm:master May 31, 2026
115 of 119 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the user to systemd-journal group by default so that journalctl --user works

4 participants