udev scripts running as root cannot use xrandr
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
xserver-xorg-video-intel (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: xorg
I use a small script called by udev (as root user) whenever I place my laptop on the docking station or remove it again. This script uses xrandr to turn off the laptop display and switch on my primary monitor (or vice versa):
DISPLAY=:0.0 xrandr --output HDMI1 --auto
DISPLAY=:0.0 xrandr --output LVDS1 --off
It used to work fine in lucid, but in maverick both commands fail:
No protocol specified
Can't open display :0.0
I've discovered two possible workarounds:
- add XAUTHORITY=
- call xhost +si:localuser:root on login (as default user)
At the moment, I use the second workaround as it is easier to implement. I can't see any reason why root should have no access, after all root has the power to take the required rights at any time. Therefore, I suggest to give root access by default, so scripts like these run without problems and this regression in comparison to lucid is fixed.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: xorg 1:7.5+6ubuntu3
ProcVersionSign
Uname: Linux 2.6.35-22-generic x86_64
Architecture: amd64
DRM.card0.
status: disconnected
enabled: disabled
dpms: Off
modes:
edid-base64:
DRM.card0.
status: disconnected
enabled: disabled
dpms: Off
modes:
edid-base64:
DRM.card0.
status: connected
enabled: enabled
dpms: On
modes: 1920x1200 1600x1200 1280x1024 1280x1024 1152x864 1024x768 1024x768 800x600 800x600 640x480 640x480 720x400
edid-base64: AP/////
DRM.card0.
status: disconnected
enabled: disabled
dpms: Off
modes:
edid-base64:
DRM.card0.LVDS.1:
status: connected
enabled: enabled
dpms: Off
modes: 1366x768
edid-base64:
DRM.card0.VGA.1:
status: disconnected
enabled: disabled
dpms: Off
modes:
edid-base64:
Date: Fri Oct 15 03:11:56 2010
DkmsStatus:
vhba, 20100822, 2.6.32-24-generic, x86_64: installed
vhba, 20100822, 2.6.32-25-generic, x86_64: installed
vhba, 20100822, 2.6.35-22-generic, x86_64: installed
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427.1)
MachineType: Sony Corporation VGN-TT11VN_X
PccardctlIdent:
Socket 0:
no product info available
PccardctlStatus:
Socket 0:
no card
ProcCmdLine: BOOT_IMAGE=
ProcEnviron:
LANG=de_DE.utf8
SHELL=/bin/bash
SourcePackage: xorg
Symptom: display
dmi.bios.date: 03/11/2009
dmi.bios.vendor: INSYDE
dmi.bios.version: R2020M4
dmi.board.
dmi.board.name: VAIO
dmi.board.vendor: Sony Corporation
dmi.board.version: N/A
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: Sony Corporation
dmi.chassis.
dmi.modalias: dmi:bvnINSYDE:
dmi.product.name: VGN-TT11VN_X
dmi.product.
dmi.sys.vendor: Sony Corporation
glxinfo: Error: [Errno 2] No such file or directory
system:
distro: Ubuntu
codename: maverick
architecture: x86_64
kernel: 2.6.35-22-generic
affects: | xorg (Ubuntu) → xserver-xorg-video-intel (Ubuntu) |
Changed in xserver-xorg-video-intel (Ubuntu): | |
status: | New → Incomplete |
Hi Alexander Steffen,
i want to write a script like you on a debian testing, can you maybe
send me your rules and the script? (<email address hidden>)
Ty very much,
Marius