On 01/06/2009 14:41, Aaron Zang wrote: > James Carlson wrote: >> Aaron Zang writes: >>> Aaron Zang wrote: >>>>> - How do these ioctls solve the problem? Who will issue the ioctls >>>>> and under what conditions? What happens if they're not used (if, >>>>> for example, something kills the Xorg server)? >>>>> >>>>> >>>> First, Xorg will open the hid devices upon startup. So the input goes >>>> to Xorg. >>>> While switching back to console, Xorg is in charge of issuing the >>>> ioctls to switch input >>>> to console since only Xorg has the context of which devices it keeps >>>> opening. >>>> >>>> If something kills the Xorg server, the opened files will be closed, >>>> so the input will >>>> automatically directed to the internal stream again. >> >> OK. I assume that Xorg can't just close the open file when switching >> to the console. >> > > > Yes, Xorg opens these files while with full privileges, for a normal > user login it will drop certain privileges, so it can not just close > the files and open again. >
So what happens if you plug in a new USB keyboard - if Xorg has dropped the privs, can it open that new device and do the ioctl? I've recently noticed some similar errors in snv115 with Xorg and the use of HAL to inform it of new HID devices: (II) config/hal: Adding input device keyboard (**) keyboard: always reports core events (**) Option "Device" "/dev/usb/hid0" (II) keyboard: Opened device "/dev/usb/hid0" (**) Option "StreamsModule" "usbkbm" (EE) keyboard: cannot push module 'usbkbm' onto keyboard device: Not owner (EE) keyboard: Unable to determine keyboard direct setting: Inappropriate ioctl for device (EE) PreInit failed for input device "keyboard" (II) UnloadModule: "kbd" (EE) config/hal: NewInputDeviceRequest failed Thanks, Darren.