Bug 255355 - graphics/wayland: Add pkg-message (Document XDG_RUNTIME_DIR)
Summary: graphics/wayland: Add pkg-message (Document XDG_RUNTIME_DIR)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL: https://specifications.freedesktop.or...
Keywords: easy, needs-qa
Depends on:
Blocks:
 
Reported: 2021-04-24 02:33 UTC by Jan Beich
Modified: 2021-05-11 17:55 UTC (History)
1 user (show)

See Also:
tobik: maintainer-feedback-
tobik: merge-quarterly+


Attachments
v1 (1.27 KB, patch)
2021-04-24 02:33 UTC, Jan Beich
no flags Details | Diff
v2 (879 bytes, patch)
2021-05-04 22:40 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2021-04-24 02:33:19 UTC
Created attachment 224392 [details]
v1

XDG_RUNTIME_DIR purpose is explained in https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html It holds unix(4) sockets for Wayland, DBus (user session), Emacs (server), uim, etc. ConsoleKit2 defines it by default but minimalistic setups (e.g., libseat or X11-nested session) don't. login.conf(5) provides a way to set environment variables regardless of user shell. Unfortunately, the directory needs to be created as some consumers will fail otherwise.

Inspired by: https://hub.darcs.net/raichoo/hikari#setting-up-xdg_runtime_dir
Fixes: "error: XDG_RUNTIME_DIR not set in the environment."
Disclaimer: Mainly affects fresh FreeBSD installs and new users, so I may have missed something.
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2021-04-24 06:22:24 UTC
Sorry, this is only tangentially related to the idea of this PR.
You bring up a problem that I think is eminently solvable in base.
I often wondered why there is no option in the base system (say via
an xdg capability in login.conf) to provision that directory (and maybe
others) at login and export the right environment variables. It
could be nicely integrated into the system based on already
existing features.

Anyway to document the problem we have right now in pkg-message
seems like a good idea to me, so FWIW +1 from me.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2021-05-04 22:40:12 UTC
Created attachment 224671 [details]
v2

One more PAM example - https://github.com/ifreund/rundird/

I've imported pam_xdg in ports d255158645da and trimmed pkg-message in v2 here. See also https://mail-index.netbsd.org/netbsd-users/2021/04/26/msg026951.html
Comment 4 Jan Beich freebsd_committer freebsd_triage 2021-05-11 03:11:46 UTC
Ping x11@. I need feedback or approval.
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-05-11 17:52:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2d487a43aa142c32eabdd8feeb4ca523d24c6a42

commit 2d487a43aa142c32eabdd8feeb4ca523d24c6a42
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-04-24 02:18:33 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2021-05-11 17:50:32 +0000

    graphics/wayland: add note about XDG_RUNTIME_DIR

    error: XDG_RUNTIME_DIR not set in the environment.

    PR:             255355
    Inspired by:    hikari
    Approved by:    maintainer timeout

 graphics/wayland/pkg-message (new) | 9 +++++++++
 1 file changed, 9 insertions(+)
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-05-11 17:54:10 UTC
A commit in branch 2021Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b33587a4adc2dc846f129cb4e167cb6efb33fa12

commit b33587a4adc2dc846f129cb4e167cb6efb33fa12
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-04-24 02:18:33 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2021-05-11 17:54:04 +0000

    graphics/wayland: add note about XDG_RUNTIME_DIR

    error: XDG_RUNTIME_DIR not set in the environment.

    PR:             255355
    Inspired by:    hikari
    Approved by:    maintainer timeout

    (cherry picked from commit 2d487a43aa142c32eabdd8feeb4ca523d24c6a42)

 graphics/wayland/pkg-message (new) | 9 +++++++++
 1 file changed, 9 insertions(+)
Comment 7 Tobias Kortkamp freebsd_committer freebsd_triage 2021-05-11 17:55:00 UTC
Committed. Thanks!