Package: acpi-support
Version: 0.109-10
Severity: important
Many /etc/acpi/*.sh scripts try to get the current X user by reading
display numbers in /tmp/.X11-unix/* and then then calling the getXuser
function (defined in /usr/share/acpi-support/power-funcs), that tries to
find the X user by looking at the output of the 'w' command.
Files in /tmp/.X11-unix are in this format:
t...@moth:~$ ls /tmp/.X11-unix/*
/tmp/.X11-unix/X0
Let's follow a script to see where the problem is. In /etc/acpi/lid.sh
we have this loop:
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
and, as I have only /tmp/.X11-unix/X0, the loop runs only once, with the
variable $displaynum set to '0'. Let's see what getXuser does.
user=`w -hs | awk '{ if ($3 == ":'$displaynum'" || $2 ==
":'$displaynum'" ) { print $1; exit; } }'`
It compares the 3rd and 2nd field of the output of 'w -hs' with
":$displaynum". But that's wrong! $displaynum is '0':
t...@moth:~$ echo $displaynum
0
but 'w -hs' reports ":0.0" in its 3rd (relevant) field!
t...@moth:~$ w -hs
torn pts/0 :0.0 30:04m -bash
torn pts/1 :0.0 1:24m -bash
....
The check always fails and the X user is not reported.
pl
-- System Information:
Debian Release: 5.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.28 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages acpi-support depends on:
ii acpi-support-base 0.109-10 scripts for handling base ACPI eve
ii acpid 1.0.8-1 Utilities for using ACPI power man
ii dmidecode 2.9-1 Dump Desktop Management Interface
ii finger 0.17-12 user information lookup program
ii hdparm 8.9-3 tune hard disk parameters for high
ii laptop-detect 0.13.7 attempt to detect a laptop
ii libc6 2.7-16 GNU C Library: Shared libraries
ii lsb-base 3.2-20 Linux Standard Base 3.2 init scrip
ii powermgmt-base 1.30+nmu1 Common utils and configs for power
ii vbetool 1.1-1 run real-mode video BIOS code to a
ii x11-xserver-utils 7.3+5 X server utilities
Versions of packages acpi-support recommends:
ii dbus 1.2.8-1 simple interprocess messaging syst
pn hal <none> (no description available)
pn nvclock <none> (no description available)
ii pm-utils 1.1.2.4-1 utilities and scripts for power ma
pn radeontool <none> (no description available)
pn toshset <none> (no description available)
Versions of packages acpi-support suggests:
ii laptop-mode-tools 1.45-1 Scripts to spin down hard drive an
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]