On 07/06/2016 02:34 PM, Martin Pitt wrote:

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.

I think we are talking somewhat in mixed direction here.

What I'm ( poorly ) trying to say is that you will need to make a clear distinction of naming on the type units for the desktop environment and the type units for the desktop environment user and potentially other existing type units on the system to avoid confusions and conflicting naming scheme, since Desktop Environments will need to have their own targets so based on my comments on this and for Gnome ( on Fedora ) and on the type units you are creating in your script ( that all have to reside in ~/.config/systemd/user/ directory for all the desktop environment user type units right ) so this would become something along the lines of

# gnome.target

[Unit]
Description=Gnome Desktop Environment
Documentation=https://wiki.gnome.org/
Requires=multi-user.target
Wants=gdm.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target gdm.service
AllowIsolate=yes

# gdm.service

[Unit]
Description=GNOME Display Manager
Conflicts=getty@tty1.service
After=getty@tty1.service
Conflicts=plymouth-quit.service
After=plymouth-quit.service
After=rc-local.service plymouth-start.service systemd-user-sessions.service
OnFailure=plymouth-quit.service

[Service]
ExecStart=/usr/sbin/gdm
KillMode=mixed
Restart=always
IgnoreSIGPIPE=no
BusName=org.gnome.DisplayManager
StandardOutput=syslog
StandardError=inherit
EnvironmentFile=-/etc/locale.conf

# gnome-user-graphical.target

[Unit]
Description=User systemd services for graphical session
StopWhenUnneeded=yes

# gnome-user.target
[Unit]
Description=User systemd services for GNOME graphical session
BindsTo=gnome-user-graphical.target  gnome-user-session.service

# gnome-user-session.service
[Unit]
Description=gnome-user-session leader
PartOf=gnome-user-graphical.target

[Service]
ExecStart=/bin/sleep infinity

# someapp.service
[Unit]
Description=example graphical app
PartOf=gnome-user-graphical.target

[Service]
ExecStart=/bin/sleep infinity

...

This will allow for

# DE units
kde.target
kdm.service
xfce.target
xdm.service
....

DE user type units
kdm-user-graphical.target
kdm-user.target
kdm-user-session.service
xfce-user-graphical.target
xfce-user.target
xfce-user-session.service
etc..

In your script you had an conflicting naming scheme ( gnome.target/graphical.target ) and a colliding one ( graphical.target with systemd default and potentially other DE's as well ) if multiple desktop environments where installed.

And you also might need to add something like an Alias ( like for example "Alias=user-graphical.target" ) directive to the DE-user-graphical.target unit so that someapp.service can be made PartOf an generic directive (PartOf=user-graphical.target) to make it DE agnostic ( should it be required to be so ) if it's not DE specific. ( if you follow me here ).

JBG
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to