systemd --user preparation work
Here's a bunch of stuff to prepare the ground for
systemd --user launched sessions.
- Add a program to do the actual launching. When we prototyped this in Ubuntu yakkety (16.10), we had a shell script to clean up any stray units and set the environment up, etc. I've made a C program to do this now, and it's what sessions will use. This is deliberately quite separate from
gnome-sessionitself, which under this scheme becomes another component of the session.
RequiredComponentsto be ignored. If we do this then we can make the transition stepwise. Sessions can be launched by
gnome-session, which will use
RequiredComponents, but the systemd units will pass
--ignore-required-componentsand then they won't be used.
SetEnvwork when the session is initialised. Maybe there's a better way to achieve this part, but I needed a way to have
SetEnvwork, so that Shell can upload
$DISPLAYetc into the environment, so that XWayland works.
- Find the logind session by asking logind instead of asking
sd_pid_get_session(), since we might not be /in/ the session.
- And finally, add some units. The structure I came up with is explained in the commit message there. It might need tweaking at some point, but it works like this.
All of this should be safe to merge right away, but please do check.
I could split this up into separate MRs if you'd prefer it like that.