Bug 255355

Summary: graphics/wayland: Add pkg-message (Document XDG_RUNTIME_DIR)
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Tobias Kortkamp <tobik>
Status: Closed FIXED    
Severity: Affects Only Me CC: tobik
Priority: --- Keywords: easy, needs-qa
Version: LatestFlags: tobik: maintainer-feedback-
tobik: merge-quarterly+
Hardware: Any   
OS: Any   
URL: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Attachments:
Description Flags
v1
none
v2 none

Description Jan Beich freebsd_committer 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 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 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 2021-05-11 03:11:46 UTC
Ping x11@. I need feedback or approval.
Comment 5 commit-hook freebsd_committer 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 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 2021-05-11 17:55:00 UTC
Committed. Thanks!