[systemd-devel] Session-specific user services

Arseny Maslennikov arseny at altlinux.org
Fri Apr 2 15:41:45 UTC 2021


Hi everyone!

Recently there's a trend for session-specific processes and services
(and even GUI apps, via `systemd-run --scope') to run as their own user
units on eligible systems/distros, to have a clean and controlled cgroup
hierarchy.

I've been looking at https://systemd.io/DESKTOP_ENVIRONMENTS/ and see no
answer to the following question: how can a process, e. g. gvfs-daemon,
know which logind-session is it run for (for example, to find out the
seat by session ID), if it's actually in a user service unit?
The libsystemd source for sd_pid_get_session(), which is used by gvfs as
of today, gives a hint that function won't work in that case, since a
user service process's /proc/self/cgroup does not contain
"session-XXX.scope".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210402/00e7f8c0/attachment.sig>


More information about the systemd-devel mailing list