From Fedora Project Wiki
 
(22 intermediate revisions by 4 users not shown)
Line 8: Line 8:


== Owner ==
== Owner ==
* Name: [[User:lennart| Lennart Poettering]]
* Name: [[User:lennart| Lennart Poettering]], [[USer:cwickert| Christoph Wickert]]
* Email: lennart at poettering dot net
* Email: lennart at poettering dot net, cwickert at fedoraproject dot org


== Current status ==
== Current status ==
* Targeted release: [[Releases/18 | Fedora 18 ]]  
* Targeted release: [[Releases/18 | Fedora 18 ]]  
* Last updated: 2012-06-27
* Last updated: 2012-10-01
* Percentage of completion: 10%
* Percentage of completion: 100%


== Detailed Description ==
== Detailed Description ==
Line 37: Line 37:


<ol>
<ol>
<li>Update all display manager packages to include a display manager unit file, of the following contents:
<li>Update all display manager packages to include a display manager system unit file (e.g. /usr/lib/systemd/system/xyzdm.service), of the following contents:
<pre>
<pre>
[Unit]
[Unit]
Line 51: Line 51:
Restart=always
Restart=always
IgnoreSIGPIPE=no
IgnoreSIGPIPE=no
# Add the following line only if your DM takes a name on the bus
BusName=org.freedesktop.XYZDisplayManager


[Install]
[Install]
Alias=display-manager.service
Alias=display-manager.service
</pre></li>
</pre>
<li>Update all display manager packages to make use of the new systemd packaging macros to install the unit files, see FPC ticket #190: https://fedorahosted.org/fpc/ticket/190</li>
</li>
<li>Patch livesys-late.service to include Before=display-manager.service (currently there is an After=livesys-late.service, but this really should live in livesys and hence be reversed).</li>
<li>Update all display manager packages to make use of the new systemd packaging macros to install the unit files, see FPC ticket #190: https://fedorahosted.org/fpc/ticket/190 -- also see the guidelines https://fedoraproject.org/wiki/Packaging:Systemd ('''Mostly done''', all important DMs are converted)</li>
<li>Update initscripts to remove the prefdm script.</li>
<li>Patch livesys-late.service to include Before=display-manager.service (currently there is an After=livesys-late.service, but this really should live in livesys and hence be reversed). ('''Bug filed''': https://bugzilla.redhat.com/show_bug.cgi?id=846384 )</li>
<li>Update systemd to remove the prefdm.service unit, and not longer ship the symlink /usr/lib/systemd/system/display-manager.service in the RPM.</li>   
<li>Update initscripts to remove the prefdm script. ('''Fixed in git''')</li>
<li>Update fedora-release.rpm to include a default fedora preset file /usr/lib/systemd/system-preset/99-default.preset which includes the following lines (which make gdm the default DM for fedora):
<li>Update systemd to remove the prefdm.service unit, and not longer ship the symlink /usr/lib/systemd/system/display-manager.service in the RPM. ('''DONE''')</li>   
<li>Update systemd.rpm to include a default fedora preset file /usr/lib/systemd/system-preset/99-default.preset which includes the following lines (which makes gdm the default DM for fedora): ('''DONE''')
<pre>
<pre>
enable gdm.service
enable gdm.service
disable *
disable *
</pre></li>
</pre></li>
<li>Ask the various spin maintainers to include their own preset files in case they want to override gdm as default WM.</li>
<li>(Optionally) Ask the various spin maintainers to include their own preset files in case they want to override gdm as default WM.</li>
<li>(Optionally) Patch initscripts to parse /etc/sysconfig/desktop at upgrade time and generate a preset file from it that is stored in /etc/systemd/system-preset/ and ensures that the original display manager choice is kept.</li>
<li>(Optionally) Patch systemd to parse /etc/sysconfig/desktop at upgrade time and generate a symlink from it that is stored in /etc/systemd/system/display-manager.service and ensures that the original display manager choice is kept. ('''DONE''')</li>
<li>The display manager configuration files should be changed so that they explicitly bind to VT1 by default. The previous logic of allocating the first unallocated VT leaves the VT random, as due to the parallized bootup VT1 might appear in use at any time simple because a status update is printed at the same time as the dm started. The display manager configuration should hence override any automatism and forcibly bind to vt1.</li>
<li>The display manager configuration files should be changed so that they explicitly bind to VT1 by default. The previous logic of allocating the first unallocated VT leaves the VT random, as due to the parallized bootup VT1 might appear in use at any time simple because a status update is printed at the same time as the dm started. The display manager configuration should hence override any automatism and forcibly bind to vt1. ('''Mostly done''')</li>
</ol>
</ol>


The following display managers are currently available in Fedora and need to be patched: xorg-x11-xdm, gdm, ldm, lxdm, cdm, kdm, slim.
Here's an '''example patch''' for ldm implementing the first two steps: https://bugzilla.redhat.com/attachment.cgi?id=602727&action=diff&context=patch&collapsed=&headers=1&format=raw
 
The following display managers are currently available in Fedora and need to be patched: xorg-x11-xdm (done), gdm (done), ldm (patch posted), lxdm (done), cdm (patch posted), kdm (done), slim (patch posted), lightdm (done).
 
We will file bugs against all display managers in question as well as the other three packages, each with detailed explanations what to do. (DONE)
 
If possible and OK'ed we will make the necessary changes to the packages on our own.


We will file bugs against all display managers in question as well as the other three packages, each with detailed explanations what to do. If possible and OK'ed we will make the necessary changes to the packages on our own. We will create a tracker bug to keep track of all created bugs.
We will create a tracker bug to keep track of all created bugs. (DONE: https://bugzilla.redhat.com/show_bug.cgi?id=846137 )


== How To Test ==
== How To Test ==
Line 88: Line 97:
== Dependencies ==
== Dependencies ==


Needs changes in all 7 display managers we currently have in the distribution, plus in initscripts, fedora-release and systemd.
Needs changes in all 7 display managers we currently have in the distribution, plus in initscripts and systemd.


FPC needs to accept ticket #190: https://fedorahosted.org/fpc/ticket/190
FPC needs to accept ticket #190: https://fedorahosted.org/fpc/ticket/190
FESCO needs to accept feature https://fedoraproject.org/wiki/Features/PackagePresets


== Contingency Plan ==
== Contingency Plan ==
If things don't work out we readd the old prefdm bits to initscripts and systemd, and change the preset files in fedora-release to not enable any DM unit files. That way we don't have to revert any work in the individual DM packages.
If things don't work out we readd the old prefdm bits to initscripts and systemd, and change the preset files in systemd to not enable any DM unit files. That way we don't have to revert any work in the individual DM packages.


== Documentation ==
== Documentation ==
http://www.freedesktop.org/software/systemd/man/systemd.preset.html explains the preset logic.
 
http://www.freedesktop.org/wiki/Software/systemd/Preset explains the preset logic.
 
http://www.freedesktop.org/software/systemd/man/systemd.preset.html explains the preset file format.


== Release Notes ==
== Release Notes ==
Line 105: Line 119:
* See [[Talk:Features/DisplayManagerRework]]
* See [[Talk:Features/DisplayManagerRework]]


[[Category:FeaturePageIncomplete]]
[[Category:FeatureAcceptedF18]]
<!-- When your feature page is completed and ready for review -->
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->
<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->
<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->

Latest revision as of 15:21, 2 October 2012

Display Manager Infrastructure Rework

Summary

We'd like to remove the prefdm logic. Instead we propose to use systemd's own symlink management to select a display manager.

At the same time we'd also like to make all display managers bind explicitly to vt1, instead of allocating the first free VT.

Owner

Current status

  • Targeted release: Fedora 18
  • Last updated: 2012-10-01
  • Percentage of completion: 100%

Detailed Description

We'd like to remove prefdm from the distribution. Instead of shipping a single prefdm.service which tries black magic to find out which DM to start, this information should be stored inside the packages themselves, and each package should ship its own service file which is symlinked to display-manager.service via "systemctl enable" commands.

We simplify the system this way and it is easier to add new display managers later on, as they don't need central registration. Selecting a window manager also becomes more uniform how we support selection of other services. And it also becomes more alike how things are done on other distributions.

We'll also be able to get rid of quite some ugly code in /etc/X11/prefdm. Information about Plymouth compatibility would then be maintained were it belongs, in the display manager packages themselves, and possibly even upstream.

Packages will make use of systemd presets so that spins have an easy way to select the window manager of their choice, simply by shipping a preset file.

We'd also like to explicitly configure all DMs to use VT1. The current mostly automatic approach doesn't work in a fully parallelized boot, simply because /dev/tty1 might appear busy because a status update is printed on it for another service that is starting. To avoid these prolems where /dev/tty1 might spuriously appear busy we should configure all DMs to explicitly bind to VT1.

Benefit to Fedora

Things generally become simple, easier and more modular. We will be more like other distros since we get rid of the Fedora-only prefdm logic, in favour of explicit unit files like they are used by other distros.

Scope

We need to make the following changes:

  1. Update all display manager packages to include a display manager system unit file (e.g. /usr/lib/systemd/system/xyzdm.service), of the following contents:
    [Unit]
    Description=XYZ Display Manager
    Documentation=man:xyzdm(8)
    Conflicts=getty@tty1.service
    After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service
    # Add the following line only if the DM can do Plymouth internally
    Conflicts=plymouth-quit.service
    
    [Service]
    ExecStart=/usr/bin/xyzdm -nofork
    Restart=always
    IgnoreSIGPIPE=no
    # Add the following line only if your DM takes a name on the bus
    BusName=org.freedesktop.XYZDisplayManager
    
    [Install]
    Alias=display-manager.service
    
  2. Update all display manager packages to make use of the new systemd packaging macros to install the unit files, see FPC ticket #190: https://fedorahosted.org/fpc/ticket/190 -- also see the guidelines https://fedoraproject.org/wiki/Packaging:Systemd (Mostly done, all important DMs are converted)
  3. Patch livesys-late.service to include Before=display-manager.service (currently there is an After=livesys-late.service, but this really should live in livesys and hence be reversed). (Bug filed: https://bugzilla.redhat.com/show_bug.cgi?id=846384 )
  4. Update initscripts to remove the prefdm script. (Fixed in git)
  5. Update systemd to remove the prefdm.service unit, and not longer ship the symlink /usr/lib/systemd/system/display-manager.service in the RPM. (DONE)
  6. Update systemd.rpm to include a default fedora preset file /usr/lib/systemd/system-preset/99-default.preset which includes the following lines (which makes gdm the default DM for fedora): (DONE)
    enable gdm.service
    disable *
    
  7. (Optionally) Ask the various spin maintainers to include their own preset files in case they want to override gdm as default WM.
  8. (Optionally) Patch systemd to parse /etc/sysconfig/desktop at upgrade time and generate a symlink from it that is stored in /etc/systemd/system/display-manager.service and ensures that the original display manager choice is kept. (DONE)
  9. The display manager configuration files should be changed so that they explicitly bind to VT1 by default. The previous logic of allocating the first unallocated VT leaves the VT random, as due to the parallized bootup VT1 might appear in use at any time simple because a status update is printed at the same time as the dm started. The display manager configuration should hence override any automatism and forcibly bind to vt1. (Mostly done)

Here's an example patch for ldm implementing the first two steps: https://bugzilla.redhat.com/attachment.cgi?id=602727&action=diff&context=patch&collapsed=&headers=1&format=raw

The following display managers are currently available in Fedora and need to be patched: xorg-x11-xdm (done), gdm (done), ldm (patch posted), lxdm (done), cdm (patch posted), kdm (done), slim (patch posted), lightdm (done).

We will file bugs against all display managers in question as well as the other three packages, each with detailed explanations what to do. (DONE)

If possible and OK'ed we will make the necessary changes to the packages on our own.

We will create a tracker bug to keep track of all created bugs. (DONE: https://bugzilla.redhat.com/show_bug.cgi?id=846137 )

How To Test

The right display manager should come up as normal on the various distributions.

The following command should work to change the default display manager for the next reboot:

systemctl enable --force xyzdm.service

User Experience

Not much changes. "systemctl enable" can now be used to enable and switch specific DMs.

Dependencies

Needs changes in all 7 display managers we currently have in the distribution, plus in initscripts and systemd.

FPC needs to accept ticket #190: https://fedorahosted.org/fpc/ticket/190

FESCO needs to accept feature https://fedoraproject.org/wiki/Features/PackagePresets

Contingency Plan

If things don't work out we readd the old prefdm bits to initscripts and systemd, and change the preset files in systemd to not enable any DM unit files. That way we don't have to revert any work in the individual DM packages.

Documentation

http://www.freedesktop.org/wiki/Software/systemd/Preset explains the preset logic.

http://www.freedesktop.org/software/systemd/man/systemd.preset.html explains the preset file format.

Release Notes

Switching display managers is no longer done by editing /etc/sysconfig/desktop. Instead you "systemctl enable --force xyzdm.service" to enable the display manager of your choice, in case you have multiple installed.

Comments and Discussion