ConsoleKit does not play nicely with multiseat configurations, resulting in failure to mount usb devices (pen drives)

Bug #218494 reported by Paulo J. S. Silva
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ConsoleKit
Confirmed
High
consolekit (Debian)
Fix Released
Unknown
consolekit (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: hal

This is a machine that was upgraded (six months ago) from 7.04 to 7.10 and not to 8.04 beta.

When I plug in an USB device hal doesn't mount it. This happens with more than one device (tried
U3 MP3 player and a small card reader). The same devices work well in my laptop that is also running hardy.

Looking at the output of hald --daemon=no I get something like:

        using action org.freedesktop.hal.storage.mount-removable for uid 1000, system_bus_connection :1.123
        pid 8027: rc=1 signaled=0: /usr/lib/hal/hal-storage-mount
        Run started hald-probe-storage (10000) (0)
        ! full path is '/usr/lib/hal/hald-probe-storage', program_dir is '/usr/lib/hal'
        woohoo
        pid 8034: rc=2 signaled=0: /usr/lib/hal/hald-probe-storage

In the laptop where everything works, I can see some extra lines just after the first above that says:

        passed privilege
        3563: XYA creating /media/.hal-mtab~
        3563: XYA closing /media/.hal-mtab~
        3563: XYA done renaming /media/.hal-mtab~ /media/.hal-mtab
        3563: XYA released lock on /media/.hal-mtab-lock

I will attach the files described in https://wiki.ubuntu.com/DebuggingRemovableDevices, maybe they can help.

The output of the id commands are:

pjssilva@leia:~$ id
uid=1000(pjssilva) gid=1000(pjssilva) grupos=4(adm),7(lp),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),100(users),104(lpadmin),105(scanner),106(admin),113(fuse),124(pulse),125(vboxusers),1000(pjssilva)
pjssilva@leia:~$ id hal
id: hal: Usuário inexistente
pjssilva@leia:~$ id haldaemon
uid=110(haldaemon) gid=110(haldaemon) grupos=110(haldaemon),24(cdrom),25(floppy),46(plugdev),121(powerdev)
pjssilva@leia:~$ uname -a
Linux leia 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux

Tags: multiseat
Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :
Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :
Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :
Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :
Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :
Revision history for this message
Paulo J. S. Silva (pjssilva) wrote :

I have found and solved the problem.

I am using a multiseat setup and the new authentication framework used in gnome,
policykit+consolekit, don't play well with old multiseat configurations.

Following the hints given in

http://linux.derkeiler.com/Mailing-Lists/Fedora/2007-09/msg03482.html

I was able to solve the problem by deleting the "-novtswitch -sharevts" options
from the calls to /usr/bin/X that are in my /etc/gdm/gdm.conf-custom.

(in this case you need to explicitly define the terminal you want to use for the multiple
sessions in the endo of the calls to /usr/bin/X).

Revision history for this message
serrs (serrs) wrote :

This was very useful, I had the same problem.

To be more clear, a person needs to remove "-novtswitch -sharevts" from ONLY one of the seat commands in gdm.conf. The Seat without those two switches will then get control over inserted USB media etc.

Daniel T Chen (crimsun)
Changed in hal:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
In , Halton Huo (halton-huo) wrote :

This is a feature requested by new GDM, which is to add gdmdynamic supporting in GDM. Refer to bug http://bugzilla.gnome.org/show_bug.cgi?id=536355.

There are two options to achieve this goal.

Option #1: Implement in ConsoleKit and GDM code. Add ck-dynamic in ConsoleKit,

        Xserver
           ^
           | STEP 4: Create/Kill a Xsession on ":101"
           |
      gdm-binary (Listern for event from ConsoleKit)
           ^
           | STEP 3: Signal CreateDisplay/RemoveDisplay event
           | with display ":101"
    _ _ _ _|
   | ck-dynamic
   | | ^
   | __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ | |
   | | |
   | | STEP 2: Require to CreateSession/RemoveSession |
   | | with display ":101" |
   | | |
   | V STEP 1: Call ck-dynamic when a display, e.g. ":101", |
ConsoleKit is added/removed. |
                                                                        |
                                                               Xmgr/gdm Script

1. gdm-binary to listen for CreateDynamicDisplay/RemoveDynamicDisplay event to org.gnome.DisplayManager.LocalDisplayFactory
2. console-kit-daemon to listen for CreateSession/RemoveSession/ListenCreatedSessions events to org.freedesktop.ConsoleKit.Manager
3. ListenCreatedSessions only talks to ConsoleKit
4. gdmdynamic is a script wrapper for ck-dynamic

Option #2: Implement inside GDM code.

 Xserver
    ^
    | STEP 4: Create/Kill Xserver regarding ":101"
    |
 gdm-binary (Listern for event from ConsoleKit)
    ^ ^
    | |__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __
    | |
    | STEP 3: Register/Unregister a X session |
    | corresponding to ":101" |
    | |
    | STEP 2: Require GDM to start/terminate Xsession for ":101" |
    | |
    | gdmdynamic
    | |
    V STEP 1: Call gdmdyncmic when a display, e.g. ":101", |
ConsoleKit is added/removed. |
                                                                Xmgr/gdm Script

Option #2 is how patch in http://bugzilla.gnome.org/show_bug.cgi?id=536355#c5 does.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=21560)
patch for bug #19333

This patch is for option #1, ConsoleKit part.

ck-dynamic work likes old gdmdynamic in http://bugzilla.gnome.org/show_bug.cgi?id=536355#c5. Following options are supportted:

      -a, --add=display Add a new display
      -d, --delete=display Delete a display
      -l, --list List all attached displays
      -r, --release Release (run) all displays waiting in the DISPLAY_CONFIG state
      -v, --verbose Verbose mode
      -V, --version Version of this application

    -a, -d, -l, -V are supportted. -r and -v are no-op by now

Brian said ConsoleKit maintainer mccann think option #1 is better.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

This patch is tested on Solaris + SunRay 4.1, so far so good.

Note, according http://projects.gnome.org/gdm/docs/2.20/binaries.html#gdmdynamiccommandline, 'ck-dynamic -l' does not accept pattern anymore. It is mainly because xserver_command does not passed to ConsoleKit and I do not think it is very useful.

If you think we need add pattern back, I can re-work on the patch.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=24683)
multi-seat and multi-display patch for ConsoleKit

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 ConsoleKit, based on 0.3.0 tarball release.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=26451)
reworked patch after Ray's review on CK's patch

There are multiple changes which are based on review by Ray Strode,
http://mail.gnome.org/archives/gdm-list/2009-May/msg00007.html

1 Use separate .disp file for display type, remove display-types.conf
  install .disp files to /etc/ConsoleKit/displays.d/,
  each .disp file represent a display type.
2 Only use Command in .disp file, remove Arguments/UseAuth/Chooser/Priority
3 Remove priority code
4 When adding/removing displays, CK should emit signal instead of
  calling GDM method directly
  For org.freedesktop.ConsoleKit.Seat
     add signal SessionToAdd and SessionToRemove
     add method ManageSeat
  For org.freedesktop.ConsoleKit.Manager
     remove method CreateStaticSessions
     add method GetUnmanagedSeats
5 Use a{sv} for dbus method CreateDisplay, since
  task #2 is done, there are only two parameters need to be send with
  signal, this work is not necessary
6 Rewrite ck-dynamic to reflect change in task #4
7 Rewrite ck_display_type_new()
8 Remove method org.freedesktop.ConsoleKit.Manager.ListCreatedSessions.
  Let ck-dynamic do the GetSeats() and filtering dynamic displays itself
9 make ck_seat_add_display(), ck_seat_set_display_type() and ck_seat_get_displ
  return a gbooolean
10 Remove unused create_display_with_parameters()
11 Comments should appear before the lines they're commenting on, not after.
12 Reverse Name and Version back
13 Figure out X11_DIR from pkg-config

This patch is reworked under branch multi-seat by commit 25145f35ab527a2219604e1710eb65e2178f6978

Richard Hansen (rhansen)
tags: added: multiseat
Revision history for this message
Richard Hansen (rhansen) wrote : Re: Default policykit configuration does not play nicely with multiseat configurations, resulting in failure to mount usb devices (pen drives)

I believe this is a consolekit limitation and not a hal bug, so I'm switching it to consolekit. Please feel free to change it back if I'm wrong.

affects: hal (Ubuntu) → consolekit (Ubuntu)
Revision history for this message
Richard Hansen (rhansen) wrote :

If you run ck-list-sessions, you'll see "active = FALSE" for each seat that has "-novtswitch -sharevts" in the X command line. I believe this is why you can't mount USB thumb drives from those seats (policykit sees the seat as inactive so it doesn't mount the drive for that seat).

Changed in hal:
status: Unknown → Confirmed
Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created an attachment (id=29538)
updated patch

The latest patch.

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created an attachment (id=30167)
updated patch

Latest version of the patch.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=30977)
updated patch

Update patch based on git-master 01e8cbff0f4dc50f24611d3ede20b62343fac976. This patch also can be applied on 0.4.1 tarball.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=31124)
Merge multi-seat branch into master

This patch is reworked with git-master 48b4b2d1174db98ee87ea4e71f4a21221043ca3f. synced with multi-seat branch commit 56d275968f8d9c866a9b69b0dcf769aba0e619af.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=31332)
Merge multi-seat branch into master

This patch is reworked with git-master 48b4b2d1174db98ee87ea4e71f4a21221043ca3f. It is synced with multi-seat branch commit f1bbdd6526e6cbceae93be941930808bd1f90a69.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=32865)
Merge multi-seat branch into master

This patch is reworked with git-master http://cgit.freedesktop.org/ConsoleKit/commit/?id=2418840248f07025ad0edc96ed17e03ce5e47f3e.

It is synced with multi-seat branch commit http://cgit.freedesktop.org/ConsoleKit/commit/?h=multi-seat&id=65d70ecd4070c1e34be24f7b050b094c76bb614b

Revision history for this message
In , Riccardo-datahost (riccardo-datahost) wrote :

Hello, any update on this?

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=36782)
Merge multi-seat branch into master

This patch is reworked with git-master
http://cgit.freedesktop.org/ConsoleKit/commit/?id=c9f2292339540d4b9d8940bcef16b7485480c8d9.

It is synced with multi-seat branch commit
http://cgit.freedesktop.org/ConsoleKit/commit/?h=multi-seat&id=1795a7eb7b1ba2f43a918d2541bf0b5814b80671

Revision history for this message
In , Halton Huo (halton-huo) wrote :

(From update of attachment 36782)
The attachment #36782 is based on 0.4.1 tarball, not on git-master.

Revision history for this message
In , Halton Huo (halton-huo) wrote :

Created an attachment (id=36798)
multi-seat branch based on git-master c9f2292339540d4b9d8940bcef16b7485480c8d9

This patch is reworked with git-master
http://cgit.freedesktop.org/ConsoleKit/commit/?id=c9f2292339540d4b9d8940bcef16b7485480c8d9.

It is synced with multi-seat branch commit
http://cgit.freedesktop.org/ConsoleKit/commit/?h=multi-seat&id=1795a7eb7b1ba2f43a918d2541bf0b5814b80671

Changed in hal:
importance: Unknown → High
Revision history for this message
In , John-haxby (john-haxby) wrote :

With this patch, this causes a crash:

  qdbus --system \
    org.freedesktop.ConsoleKit
    /org/freedesktop/ConsoleKit/SessionStaticSeat1Local \
    org.freedesktop.DBus.Introspectable.Introspect

The problem seems to be that src/org.freedesktop.ConsoleKit.Session.xml contains definitions for the properties "session", "is-open" and "is-dynamic" but there's no corresponding code for them and so console-kit-daemon crashes when it tries to build the xml.

There's some code for "is-open" but it looks as though it falls short of actually calling g_object_class_install_property().

There are other properties defined by the code (display-template, display-variables, ever-open and seat-id?) that are defined by the code but not in src/org.freedesktop.ConsoleKit.Session.xml.

I'm unsure what the best way forward is here: should the three undefined properties be simply removed from the xml or should there be code put in place to support them (even though they're not used). And should the extra properties be defined in the xml?

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created an attachment (id=38768)
updated patch

Here is the latest patch that we are using on Solaris which builds against ConsoleKit 0.4.2.

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

I think the is_dynamic code is unused and could likely be removed. Not sure about the best thing to do with the is_open code.

I just attached the latest patch that we use with Solaris. It doesn't address the issues you raised, but it does have a few minor bug fixes.

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created an attachment (id=38890)
This is the latest patch that we use with ConsoleKit 0.4.1

This is the latest patch we use with ConsoleKit 0.4.1 in case people are using the older version of ConsoleKit.

Changed in hal:
importance: High → Unknown
Changed in hal:
importance: Unknown → High
Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created attachment 43782
Updated ConsoleKit patch for 0.4.1

Updated patch for 0.4.1. This fixes the open-session-request and
close-session-request signals in the ck-seat.c code is better defined which
avoids warning messages like these going to the syslog.

WARNING: signal "open_session_request" (from "OpenSessionRequest") exported but not found in object class "CkSeat"
WARNING: signal "close_session_request" (from "CloseSessionRequest") exported but not found in object class "CkSeat"

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created attachment 43783
Updated patch for ConsoleKit 0.4.2.

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created attachment 49167
Updated patch for ConsoleKit 0.4.1

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 ConsoleKit 0.4.1.

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created attachment 49168
Updated patch for ConsoleKit 0.4.5

Or this patch with ConsoleKit 0.4.5

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created attachment 49169
Sunray.display file

If you want to use this with Sun Ray, note you need to install this configuration file as /etc/ConsoleKit/displays.d/Sunray.display. This just simply configures the Xserver for Sun Ray to use.

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created attachment 54478
Updated patch for ConsoleKit 0.4.1

This updated patch addresses some robustness issues, fixing the code so that it will not try to respawn displays when the Xserver fails.

Revision history for this message
In , Brian-cameron-oracle (brian-cameron-oracle) wrote :

Created attachment 54479
Updated patch for ConsoleKit 0.4.5

Updated patch for 0.4.5. Note that this code is now maintained upstream in the wip/multi-seat branch:

  http://cgit.freedesktop.org/ConsoleKit/log/?h=wip/multi-seat

Richard Hansen (rhansen)
affects: hal → consolekit
summary: - Default policykit configuration does not play nicely with multiseat
- configurations, resulting in failure to mount usb devices (pen drives)
+ ConsoleKit does not play nicely with multiseat configurations, resulting
+ in failure to mount usb devices (pen drives)
Changed in consolekit (Debian):
status: Unknown → New
Changed in consolekit (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.