Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jun 2023 15:20:18 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Graham Perrin <grahamperrin@freebsd.org>
Cc:        FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: Directory 1002/ missing from /var/run/user/
Message-ID:  <cz20-keb1-wny@FreeBSD.org>
In-Reply-To: <b56e962e-014e-f0ba-e378-c622fee7a674@freebsd.org> (Graham Perrin's message of "Mon, 12 Jun 2023 01:32:42 %2B0100")
References:  <b56e962e-014e-f0ba-e378-c622fee7a674@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Graham Perrin <grahamperrin@freebsd.org> writes:

> What normally takes care of creation of the numbered directories?

/var/run/user/ (or /run/user/ on Linux with systemd) is a common prefix
for XDG_RUNTIME_DIR, a standardized place for user-owned unix(4) sockets.
Fallbacks are either app-specific or shared (e.g., CVE-2020-25697).

/var/run/user/<UID> is managed by sysutils/consolekit2 or sysutils/pam_xdg.
In consolekit2 case the directory is created (contents destroyed if
already exists) on the first session of the specific UID either via
C API, DBus API, ck-launch-session(1) or pam_ck_connector(8) and removed
when the last session terminates. In pam_xdg case the directory is
created but not removed unless track_sessions is set.

> A few hours ago, it was unexpectedly missing:

Probably auto-removed by consolekit2 either due to logout or dbus restart.

> I recreated the directory.

Can be automated via PAM e.g.,

  # pkg install consolekit2
  # echo "session optional pam_ck_connector.so nox11" >>/etc/pam.d/system
  # service dbus onestart
  $ exit # log out on VT console to re-trigger PAM

or

  # pkg install pam_xdg
  # echo "session optional pam_xdg.so notroot runtime" >>/etc/pam.d/system
  $ exit # log out on VT console to re-trigger PAM



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cz20-keb1-wny>