I would argue that this method is farther away from the same environment when running from a logged in interactive session, since no user manager gets started.Have you considered implementing the systemd service as a USER service? Don't need to su then, and the environment and it runs in a full user manager environment.
As a user service you can have it start when you login interactively to the console, or automatically at system boot via 'loginctl enable-linger'.
I suspect OP is using su - to get close to the same environment as when running from a logged in interactive session. There's one difference that it won't fix however: the shell under systemd won't be attached to a tty unless the service is specifically configured to do so. Relevant systemd documentation is here: https://www.freedesktop.org/software/sy ... .exec.html
There may also be security issues or policies that prevent wayland starting from a service. There definitely are for X.
I wonder if this will require lightdm to be active so that a 'seat' gets created?
This doesn't seem terribly difficult to work out, just a bit of reverse engineering of the full Desktop environment.
OP, you should be able to use X11 and get this done with a fair amount less frustration and hair-pulling. Is that an option for you?
Statistics: Posted by bls — Fri Sep 06, 2024 6:49 pm