After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 536355 - Support MultiSeat features and gdmdynamic in GDM 2.22 and later
Support MultiSeat features and gdmdynamic in GDM 2.22 and later
Status: RESOLVED OBSOLETE
Product: gdm
Classification: Core
Component: general
2.22.x
Other All
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
: 577227 (view as bug list)
Depends on:
Blocks: 586777 616258
 
 
Reported: 2008-06-03 01:53 UTC by Brian Cameron
Modified: 2013-11-18 14:45 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
patch adding gdmdynamic functionality (45.66 KB, patch)
2008-06-03 01:55 UTC, Brian Cameron
none Details | Review
Test scripts for gdmdynamic (1.54 KB, application/x-compressed-tar)
2008-06-03 02:04 UTC, Brian Cameron
  Details
updated patch (42.09 KB, patch)
2008-09-04 19:05 UTC, Brian Cameron
none Details | Review
Updated patch for GDM 2.24 (42.35 KB, patch)
2008-10-23 12:50 UTC, Brian Cameron
none Details | Review
patch in option #1 (50.92 KB, patch)
2008-12-30 03:54 UTC, Halton Huo
none Details | Review
multi-seat and multi-display patch for GDM (93.56 KB, patch)
2009-04-09 10:45 UTC, Halton Huo
none Details | Review
multi-seat and multi-display patch for GDM (92.18 KB, patch)
2009-05-04 09:15 UTC, Halton Huo
none Details | Review
reworked patch after Ray's review on CK's patch (77.60 KB, patch)
2009-06-05 02:14 UTC, Halton Huo
none Details | Review
updated patch (151.62 KB, patch)
2009-09-14 19:00 UTC, Brian Cameron
none Details | Review
the latest patch (154.21 KB, patch)
2009-10-10 15:38 UTC, Brian Cameron
none Details | Review
the latest patch (143.74 KB, patch)
2009-11-05 10:21 UTC, Halton Huo
none Details | Review
Merge display-configuration branch into master (152.16 KB, patch)
2009-11-12 03:56 UTC, Halton Huo
none Details | Review
Merge display-configuration branch into master (155.74 KB, patch)
2010-01-28 07:04 UTC, Halton Huo
none Details | Review
Merge display-configuration branch into master (155.75 KB, patch)
2010-03-09 03:42 UTC, Halton Huo
none Details | Review
Merge display-configuration branch into gdm-2.30.4 tarball (160.41 KB, patch)
2010-07-06 07:24 UTC, Halton Huo
none Details | Review
latest patch (157.55 KB, patch)
2010-09-17 18:33 UTC, Brian Cameron
none Details | Review
Latest patch for 2.31 (157.78 KB, patch)
2010-09-22 22:18 UTC, Brian Cameron
none Details | Review
latest patch for GDM 2.30.5 (160.63 KB, patch)
2010-09-22 22:19 UTC, Brian Cameron
none Details | Review
test for gdmdynamic/ck-seat-tool (3.21 KB, application/x-bzip)
2010-09-22 22:21 UTC, Brian Cameron
  Details
fix X11 server command line corruption (5.14 KB, patch)
2011-02-19 05:05 UTC, a7x
reviewed Details | Review
handle NULL X11 server command line (1.35 KB, patch)
2011-02-19 05:17 UTC, a7x
reviewed Details | Review
Latest patch for GDM 2.30.5 (160.79 KB, patch)
2011-02-22 19:14 UTC, Brian Cameron
none Details | Review
Updated patch for 2.32. (157.93 KB, patch)
2011-02-22 19:15 UTC, Brian Cameron
none Details | Review
Updated patch for 2.30.5 (160.78 KB, patch)
2011-02-25 07:08 UTC, Brian Cameron
none Details | Review
Updated patch for 2.32.0 (157.93 KB, patch)
2011-02-25 07:09 UTC, Brian Cameron
none Details | Review
Updated patch (163.66 KB, patch)
2011-07-16 01:48 UTC, Brian Cameron
none Details | Review
Patch for GDM 3.1 (162.90 KB, patch)
2011-07-16 01:49 UTC, Brian Cameron
none Details | Review
Updated gdmdynamic (1.70 KB, text/plain)
2011-07-16 01:49 UTC, Brian Cameron
  Details
Patch for gdm 2.32 (161.68 KB, patch)
2011-07-17 23:33 UTC, a7x
none Details | Review
Updated patch for GDM 2.30.7 (169.87 KB, patch)
2011-12-16 03:44 UTC, Brian Cameron
none Details | Review
Updated patch for GDM 3.1.2 (169.57 KB, patch)
2011-12-16 03:50 UTC, Brian Cameron
none Details | Review

Description Brian Cameron 2008-06-03 01:53:13 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.
Comment 1 Brian Cameron 2008-06-03 01:55:20 UTC
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.
Comment 2 Brian Cameron 2008-06-03 02:04:17 UTC
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.
Comment 3 Brian Cameron 2008-09-04 19:05:23 UTC
Created attachment 118039 [details] [review]
updated patch


Here is an updated patch that applies against the latest GDM.
Comment 4 Brian Cameron 2008-09-04 19:39:05 UTC
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.
Comment 5 Brian Cameron 2008-10-23 12:50:55 UTC
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.
Comment 6 Halton Huo 2008-12-30 03:54:53 UTC
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.
Comment 7 Brian Cameron 2009-01-13 21:51:00 UTC
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.
Comment 8 Halton Huo 2009-04-09 10:45:28 UTC
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.
Comment 9 Halton Huo 2009-05-04 09:15:28 UTC
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'
Comment 10 Halton Huo 2009-06-05 02:14:50 UTC
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.
Comment 11 Brian Cameron 2009-09-14 19:00:27 UTC
Created attachment 143181 [details] [review]
updated patch


Attaching the latest version of the patch for reference.
Comment 12 Brian Cameron 2009-10-10 15:38:52 UTC
Created attachment 145214 [details] [review]
the latest patch
Comment 13 Halton Huo 2009-11-05 10:21:03 UTC
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.
Comment 14 Halton Huo 2009-11-12 03:56:58 UTC
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.
Comment 15 Halton Huo 2010-01-28 07:04:48 UTC
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.
Comment 16 Halton Huo 2010-03-09 03:42:35 UTC
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.
Comment 17 Brian Cameron 2010-04-26 17:48:11 UTC
*** Bug 577227 has been marked as a duplicate of this bug. ***
Comment 18 Halton Huo 2010-07-06 07:24:41 UTC
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
Comment 19 Brian Cameron 2010-09-17 18:33:23 UTC
Created attachment 170509 [details] [review]
latest patch

Here is the latest patch build against 2.31.92.
Comment 20 Brian Cameron 2010-09-22 22:18:42 UTC
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.
Comment 21 Brian Cameron 2010-09-22 22:19:36 UTC
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
Comment 22 Brian Cameron 2010-09-22 22:21:57 UTC
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.
Comment 23 leon 2010-10-06 12:38:16 UTC
Does this mean multiseat isn't supported in Gnome 2.32?
Comment 24 a7x 2011-02-19 05:05:02 UTC
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).
Comment 25 a7x 2011-02-19 05:17:31 UTC
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.
Comment 26 Brian Cameron 2011-02-21 15:15:40 UTC
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.
Comment 27 Brian Cameron 2011-02-21 15:50:30 UTC
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.
Comment 28 Brian Cameron 2011-02-22 19:14:50 UTC
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.
Comment 29 Brian Cameron 2011-02-22 19:15:49 UTC
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.
Comment 30 a7x 2011-02-23 02:17:54 UTC
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).
Comment 31 a7x 2011-02-23 03:09:01 UTC
(I mean the display-configuration branch, not master)
Comment 32 Brian Cameron 2011-02-25 07:08:28 UTC
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");
Comment 33 Brian Cameron 2011-02-25 07:09:30 UTC
Created attachment 181901 [details] [review]
Updated patch for 2.32.0

Updated patch with the same change.
Comment 34 Brian Cameron 2011-07-16 01:48:04 UTC
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
Comment 35 Brian Cameron 2011-07-16 01:49:09 UTC
Created attachment 192075 [details] [review]
Patch for GDM 3.1

I have also ported this patch to GDM 3.1
Comment 36 Brian Cameron 2011-07-16 01:49:59 UTC
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.
Comment 37 a7x 2011-07-17 23:33:36 UTC
Created attachment 192153 [details] [review]
Patch for gdm 2.32

This is the latest patch ported to gdm 2.32.1.
Comment 38 Brian Cameron 2011-12-16 03:44:07 UTC
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
Comment 39 Brian Cameron 2011-12-16 03:50:52 UTC
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
Comment 40 Brian Cameron 2012-04-20 00:30:16 UTC
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
Comment 41 a7x 2012-09-30 23:26:10 UTC
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
Comment 42 a7x 2012-09-30 23:56:17 UTC
I just noticed bug #655380; is this bug now obsolete?
Comment 43 Ray Strode [halfline] 2012-10-01 15:44:19 UTC
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.
Comment 44 Ray Strode [halfline] 2013-11-18 14:45:31 UTC
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.