[systemd-devel] Standardizing names for graphical session units

Martin Pitt martin.pitt at ubuntu.com
Wed Jul 6 14:34:54 UTC 2016


Jóhann B. Guðmundsson [2016-07-06 14:02 +0000]:
> Martin is proposing changes to and dependency's on the graphical.target

I'm not changing anything. graphical.target as it exists in systemd
today is for the *system* instance. I'm talking about the *user*
instance, which has no graphical.target at all right now. You could
also call it graphical-session.target.

> trying to make it act as the abstraction layer ( since there does not exist
> a single DM solution that serves all DE properly ) which will never work
> since each desktop environment will need it's own target which can be
> isolated to so applications/administrators and end users can switch desktop
> environments

Correct, every desktop environment will need its own target. This plus
the generic graphical.target are precisely for supporting multiple
parallel session types.

> If you only have a single DE environment installed you could just make that
> DE the default target of the installment and skip entirely the graphical
> target if everything gets correctly implemented

No, even that wouldn't work. default.target is also run for
non-graphical user sessions, such as ssh, VT, or even cron. These must
*not* try to start graphical stuff like gnome-session.

> however if you try to use a DM that belongs to an single desktop environment
> ( as opposed to one DM to rule them all ) with multiple desktop environments
> you will always end up with a mess on your hand.

This is all fairly unrelated to DMs really.

> In anycase none of the desktop environment targets should ever be shipped
> with systemd upstream and depend on graphical.target but only be as a part
> of their relevant desktop environment, shipped with it and depend on it's
> own target.

Correct, and that's what I proposed. But we need the graphical.target
so that we can sanely make graphical user services get stopped with
the graphical session without having to update them all the time.

This was explained in several other parts of the thread, but suppose
you have gnome-settings-daemon.service: With just "gnome.target" this
would need a "PartOf=gnome.target", so that stopping gnome.target also
stops gnome-settings-daemon.service.

Now suppose we add a mate.target for a MATE session, which also
happens to use g-s-d. We would now need to modify
gnome-settings-daemon.service to add "PartOf=mate.target", and do the
same to all other session services that are shared between multiple
desktop session types. This is a combinatorial explosion and pointless
update exercise. We can assume that we only have (at most) *one*
graphical session running (that's dbus-user-session's building
principle) and so we can insert this "graphical.target" in the middle
to mean "the current graphical session", so that
gnome-settings-daemon.service and friends only need
"PartOf=graphical.target" and they never need to be updated for
new session types.

This /usr/lib/systemd/user/graphical.target (and only that) *does*
belong in to systemd, as it cannot sensibly be in any
gnome-session/mate-session/kde-session/etc. package -- it's a shared
resource/synchronization point between all of those. Having a unit
structure which actually works and is reasonably easy to extend and
maintain is AFAICS the main blocker why systemd isn't being used for
desktop environments at all yet.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the systemd-devel mailing list