I use systemd to start most of my processes for a desktop session: xmonad (the window manager), emacs daemon, a tmux session, etc.
Listing my users processes with loginctl user-status
consequently only shows a handful of processes under the session:
Unit: user-1000.slice
├─session-5.scope
│ ├─4740 lightdm --session-child 13 16
│ ├─5047 systemctl --user --wait start xmonad-systemd-session.target
│ └─5497 /usr/bin/ssh-agent /usr/bin/im-launch xmonad-systemd-session
└─user@1000.service
Almost all my processes run outside of the session below user@1000.service
. That means running loginctl session-status
from tmux gives:
Could not get properties: Caller does not belong to any known session
I would like to tell systemd to start certain services under a particular login session. Ideally, in my session starter script I would write:
exec systemctl --user --wait \
--scope $MY_DESKTOP_SESSION start xmonad-systemd-session.target
However there is no --scope
option nor would I know how to get the scope name.
I run systemd 240 on a Debian-ish (inhouse) distro with libpam-systemd and dbus-user-session.
loginctl user-status
under my user@1000.service, but they're literally in the output, which it doesn't sound like yours are. – Schlueter Oct 24 '19 at 03:58