GNOME Bugzilla – Bug 536355
Support MultiSeat features and gdmdynamic in GDM 2.22 and later
Last modified: 2013-11-18 14:45:31 UTC
In GDM 2.20 and earlier, it supported the ability to start and stop displays dynamically, by command. This is useful for a variety of purposes: - Stress-testing GDM by running GDM so it manages a lot of displays via Xvfb. - Providing the ability to dynamically start or stop displays in a multi-terminal environment. This allows displays to be added or removed on-the-fly, in a hotswap fashion, without needing to restart the GDM daemon processes. - If someone wanted to write a daemon that listened for some event, and only wanted a display to be managed after an event was received, it would be fairly easy to script GDM to work this way via using gdmdynamic. Likewise it is easy to cause a display to be remanaged using the same technique. I would appreciate any comments about what additional work is needed to get this functionality upstream.
Created attachment 112014 [details] [review] patch adding gdmdynamic functionality This patch was written by Simon Zheng. There was some discussion about this patch on the gdm-list@gnome.org mailing list. This is an updated version of the patch that applies against the latest GDM 2.22 code. Several bugs were also fixed as we tested the patch. We have tested GDM 2.22 in a Sun Ray environment and can verify that it works as expected.
Created attachment 112015 [details] Test scripts for gdmdynamic This attachment is a tarball compressed with bzip2. The tarball contains a set of test scripts that show how GDM can be stress-tested with Xvfb using gdmdynamic. The tarball contains a README explaining how to use the test scripts.
Created attachment 118039 [details] [review] updated patch Here is an updated patch that applies against the latest GDM.
Note that in previous testing of this patch, some configuration features didn't work perfectly. For example, the background image would not display on any displays except for the first display, oddly. This didn't seem like a showstopper issue, but I wanted to highlight the sorts of bugs that might be noticeable when using this patch. Obviously such issues should noticed should be reported as bugs, since there's no reason why GDM shouldn't work properly whether it is managing one or more displays.
Created attachment 121195 [details] [review] Updated patch for GDM 2.24 This patch is updated so it will compile with the latest 2.24 version of GDM.
Created attachment 125497 [details] [review] patch in option #1 Please look at bug https://bugs.freedesktop.org/show_bug.cgi?id=19333. I give detailed information how to fix in GDM and ConsoleKit. The old patches are based on idea option #2. This is patch based on option #1, GDM part.
Just to clarify on Halton's last comment. There was some debate about whether such a dynamic feature should talk directly to GDM or ConsoleKit. The patches in comments #2-#5 were written with the assumption that gdmdynamic talk directly to GDM. The patch in comment #6 makes GDM work with a ck-dynamic program, which talks to ConsoleKit, which then informs GDM to start a display. According to discussions with Jon McCann, this is the preferred approach for this feature to work properly.
Created attachment 132400 [details] [review] multi-seat and multi-display patch for GDM With discussion with gdm-list, we comes out a design for multi-seat and multi-display support. The design is located at http://wiki.genunix.org/wiki/index.php/design_for_newgdm_consolekit_multiseat_multidisplay. This patch is part for gdm, based on 2.26.0 tarball release.
Created attachment 133909 [details] [review] multi-seat and multi-display patch for GDM rework this patch with gdm-2.26.1 tarball release. And add property disable-tcp back to GdmServer otherwise there are warnings in /var/adm/messages > Apr 28 20:32:24 brianca gdm-simple-slave[1336]: [ID 702911 > daemon.warning] GLib-GObject-WARNING: g_object_set_valist: object class > `GdmServer' has no property named `disable-tcp'
Created attachment 135995 [details] [review] reworked patch after Ray's review on CK's patch There are mutiple changes which are based on review by Ray Strode, http://mail.gnome.org/archives/gdm-list/2009-May/msg00007.html Some comments need change in GDM compared with previous patch #133909. 1 Remove priority code 2 Remove arguments, tty_device and priority in GdmDisplay, only use command to parse 3 When adding/removing displays, CK should emit signal instead of calling GDM method directly GDM connect SeatAdded signal to know which seats are added, then connect SessionToAdd/SessionToRemove signals for each seats. This patch is rework under branch display-configuration.
Created attachment 143181 [details] [review] updated patch Attaching the latest version of the patch for reference.
Created attachment 145214 [details] [review] the latest patch
Created attachment 146992 [details] [review] the latest patch Update patch based on git-master 0be9c66d5542fff3d0fb23e63da3b704622b890d. This patch also can be applied on 2.28.1 tarball.
Created attachment 147528 [details] [review] Merge display-configuration branch into master This patch is reworked with git-master c166876aad65b0e437cf043faed56efa78992fde, synced with multi-seat branch commit 396cc651054a850fc742212d8a533d5c2042e4d0.
Created attachment 152465 [details] [review] Merge display-configuration branch into master This patch is reworked with gdm-2.29.6 code base, synced with display-configuration branch commit http://git.gnome.org/browse/gdm/tree/?h=display-configuration&id=8c35f8ff9dd6151f1b52a1c4c26ff979991f6da5.
Created attachment 155610 [details] [review] Merge display-configuration branch into master This patch is reworked with gdm-2.29.92 code base, synced with display-configuration branch commit http://git.gnome.org/browse/gdm/tree/?h=display-configuration&id=8c35f8ff9dd6151f1b52a1c4c26ff979991f6da5.
*** Bug 577227 has been marked as a duplicate of this bug. ***
Created attachment 165326 [details] [review] Merge display-configuration branch into gdm-2.30.4 tarball This patch is reworked with gdm-2.30.4 code base, synced with display-configuration branch commit http://git.gnome.org/browse/gdm/commit/?h=display-configuration&id=098075c7f48ba506bf224a5f71c6cd07f903fd89
Created attachment 170509 [details] [review] latest patch Here is the latest patch build against 2.31.92.
Created attachment 170868 [details] [review] Latest patch for 2.31 This is the latest patch for GDM 2.31. This patch includes some fixes for a few robustness issues that were causing problems. This code is being exercised much more in the recent past and it seems to be working well now.
Created attachment 170869 [details] [review] latest patch for GDM 2.30.5 This is the latest patch with the same fixes for GDM 2.30.5
Created attachment 170870 [details] test for gdmdynamic/ck-seat-tool This is a tar.bz2 file which contains test scripts that show how ck-seat-tool can be used to launch Xvfb displays. This is useful for stress testing. These are updated scripts from Comment #2 that work with the latest code. The test scripts in Comment #2 only worked with the old GDM 2.20 or earlier while these test scripts work with both the old and new GDM.
Does this mean multiseat isn't supported in Gnome 2.32?
Created attachment 181302 [details] [review] fix X11 server command line corruption I applied the 2.30.5 patch and discovered a problem: My X11 server command line for display :0 had '-isolateDevice PCI:2:0:0' in it, and the strrep() calls changed it to '-isolateDevice PCI:2'. Xorg didn't like that very much. I'm attaching a patch that fixes the problem (and simplifies the code).
Created attachment 181303 [details] [review] handle NULL X11 server command line When merging the 2.30.5 patch with Ubuntu's various patches, I resolved a conflict incorrectly. This led to server->priv->command being NULL by the time gdm_server_resolve_command_line() was called, which g_shell_parse_argv() didn't like. (My mistake.) I'm attaching a patch that prevents gdm from segfaulting when server->priv->command == NULL. The patch isn't a fix to an existing problem; it's purely defensive. Hopefully it will help others avoid similar mistakes.
Looks like good work, a7x. Also note that I have had several people report that they need the patch mentioned in this report for the code to work well: http://mail.gnome.org/archives/gdm-list/2009-November/msg00002.html Might be nice to provide an update full patch with all these fixed integrated.
I should also mention that this past summer at GUADEC I had a meeting with Jon McCann about possibly integrating this patch. Jon seemed to feel that this patch was not yet ready for upstream inclusion in GDM mainly because it does not deal with handing device permissions. I believe Jon thinks that GDM and ConsoleKit should, in addition to what this code does, also do things like manage setting up the display/keyboard/mouse/etc. device permissions properly. I remember Jon suggesting that that would likely involve integrating ConsoleKit with DeviceKit (or whatever DeviceKit is evolving into). He seemed to indicate that most, if not all, display specific device configuration could be handled automatically via probing the devices. But it may still be necessary to provide hooks to allow sysadmins to configure things for systems where probing may not work. The old GDM (2.20 and earlier) supported multi-seat much in the same way that this patch implements and did not manage device permissions at all. Sysadmins would like have needed to do any such needed device permission setup in the PostLogin or PreSession script. I would think that it should be possible to add interfaces later to support managing device permissions. So, I think we could still consider integrating this feature even before device permissions are managed. Jon seemed concerned, though, that how this should integrate with device permissions might affect the design. So, there would be value in discussing this, I think. DeviceKit is not currently used on Solaris and most of the people who have worked on this patch work on Solaris. Solaris uses its own mechanism (logindevperm) to manage device permissions. I suspect that the remaining work may need to be done by people who have a closer understanding of DeviceKit. Hopefully I have captured the state of this work, but I hope that Jon clarifies if my memory is off.
Created attachment 181620 [details] [review] Latest patch for GDM 2.30.5 Updated patch for GDM 2.30.5. This incorporates the latest improvements by a7x in comments 24-25 and the fix proposed by Jens Langner in the email mentioned in comment 26.
Created attachment 181621 [details] [review] Updated patch for 2.32. Updated patch for GDM 2.32.0. This also incorporates the latest improvements by a7x in comments 24-25 and the fix proposed by Jens Langner in the email mentioned in comment 26.
Does anyone have commit access to the Git repository? If the changes are acceptable, I'd prefer they be placed somewhere more permanent (and where they can be easily reviewed by others).
(I mean the display-configuration branch, not master)
Created attachment 181900 [details] [review] Updated patch for 2.30.5 This updated patch just changes the following message from a g_warning call to a g_debug call since it is harmless and shows up in the syslog a lot. > + g_debug ("Got console request to add display for session that " > + "already has a display, and display is already in " > + "use");
Created attachment 181901 [details] [review] Updated patch for 2.32.0 Updated patch with the same change.
Created attachment 192074 [details] [review] Updated patch I have done a lot of work improving the robustness of the MultiSeat patch and it is now working a lot better. I recommend using this patch with GDM 2.30
Created attachment 192075 [details] [review] Patch for GDM 3.1 I have also ported this patch to GDM 3.1
Created attachment 192076 [details] Updated gdmdynamic This gdmdynamic script wrapper can be used for compatibility with the old GDM. This version includes some bug fixes.
Created attachment 192153 [details] [review] Patch for gdm 2.32 This is the latest patch ported to gdm 2.32.1.
Created attachment 203626 [details] [review] Updated patch for GDM 2.30.7 This is an updated patch that addresses robustness issues recently identified. Now the slave pays attention to the Xserver return code, and avoids trying to remanage displays that fail to start an Xserver. Note that this latest patch is now in the multi-seat-2-30 GIT branch: http://git.gnome.org/browse/gdm/log/?h=wip/multi-seat-2-30
Created attachment 203627 [details] [review] Updated patch for GDM 3.1.2 Patch updated for GDM 3.1.2. Note that this code is in the wip/multi-seat GIT branch upstream: http://git.gnome.org/browse/gdm/log/?h=wip/multi-seat This patch needs to be ported to newer versions of GDM. There is likely some rework needed to address the fact that the welcome session was changed in this commit: http://git.gnome.org/browse/gdm/commit/?h=gnome-3-2&id=647cad5bf59a4ff3776ba1ae5cda6b1aaaa1cfb2
Note that the latest code for this feature is now here in a branch in GIT. This makes more sense than updating the patches here. The patches are obsolete: For GDM 2.30: http://git.gnome.org/browse/gdm/log/?h=wip/multi-seat-2-30 For GDM 3, but it is a bit out of date. Last tested with GDM 3.2 http://git.gnome.org/browse/gdm/log/?h=wip/multi-seat
It looks like Ray Strode has reworked GDM's ConsoleKit code; see [1] for an example. It is no longer possible to trivially merge master into the wip/multi-seat branch. What's the state of multiseat support in master now? [1] http://git.gnome.org/browse/gdm/commit/?id=a0217bb095bd8e86e691d3e00472d1eb9d1d21e1
I just noticed bug #655380; is this bug now obsolete?
This bug is about the consolekit integration of multiseat, that bug is the systemd integration. ConsoleKit is slowly being deprecated away and will probably eventually be considered obsolete, but at the moment it's supported, so this bug makes sense to keep open.
I'm going to go ahead and close this out. I think all the stakeholders in this patch have moved on to other things, and I really don't see it getting fixed up and merged.