Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92804 - Xlock didn't start when I unplugged usb storage device
Summary: Xlock didn't start when I unplugged usb storage device
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-16 09:39 UTC by Nemanja Jakovljevic
Modified: 2005-07-05 12:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nemanja Jakovljevic 2005-05-16 09:39:19 UTC
In /etc/pam_usb/hotplug.conf I set enable to 1, and enabled log for the usbhotplug. Now it should lock X when I unplug my usb storage device.

In log this is what happens:

[usbhotplug] --- LOG STARTED ---
[usbhotplug] Received a hotplug event
[usbhotplug] Cannot retrieve device informations
[usbhotplug] Access denied for user root, starting the handler
[usbhotplug] Running as user root [ uid:0 | gid:0 ]
[usbhotplug] Starting the lock handler
[usbhotplug] About to execute /etc/pam_usb/handlers/xlock.sh start...
[usbhotplug] --- LOG STARTED ---
[usbhotplug] Received a hotplug event
[usbhotplug] Cannot retrieve device informations
[usbhotplug] Access granted for user root, starting the handler
[usbhotplug] Running as user root [ uid:0 | gid:0 ]
[usbhotplug] Starting the unlock handler
[usbhotplug] About to execute /etc/pam_usb/handlers/xlock.sh stop...

I tried to edit script xlock.sh, and added line:

touch /root/test in the start section of the script, and file was created.

After that I tried to run from terminal the command 
/etc/pam_usb/handlers/xlock.sh start
and it started xlock as it should.

Reproducible: Always
Steps to Reproduce:
1.Unplug usb storage device, and xlock wont be started, but it should be
2.
3.

Actual Results:  
Nothing. Just entries in the log

Expected Results:  
It should have started xlock

root@jaguar /var/log # emerge info
Portage 2.0.51.21-r1 (default-linux/x86/2005.0, gcc-3.3.5, glibc-2.3.5-r0,
2.6.11-cko5 i686)
=================================================================
System uname: 2.6.11-cko5 i686 AMD Athlon(tm) XP 2500+
Gentoo Base System version 1.6.11
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.8
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=athlon-xp -pipe -mmmx -msse -mfpmath=sse,387 -m3dnow
-momit-leaf-frame-pointer -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -pipe -mmmx -msse -mfpmath=sse,387 -m3dnow
-momit-leaf-frame-pointer -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://mirror.etf.bg.ac.yu/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/storage/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X acpi alsa apache2 avi bash-completion bitmap-fonts bzlib
cdparanoia cdr cups divx4linux dvd dvdr dvdread encode gimpprint gpm gtk gtk2
jabber mp3 ncurses nls nptl offensive ogg oggvorbis opengl oss pam perl png
quicktime sse ssl truetype truetype-fonts type1-fonts usb v4l xmms xv zlib
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Andrea Luzzardi 2005-07-05 12:42:25 UTC
This is because the handler is not authorized to connect to the X server.
To fix this you have to add xhost +root (or whatever username you have used on /etc/pam_usb/
hotplug.conf) to your .xinitrc.