Bug 74285 - GNOME with HAL and gamin doesn't update the presence of usb stick
Bug#: 74285 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: gnome@gentoo.org Reported By: sebastian.droege@gmx.de
Component: GNOME
URL:  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=135337
Summary: GNOME with HAL and gamin doesn't update the presence of usb stick
Keywords:  
Status Whiteboard: 
Opened: 2004-12-13 07:45 0000
Description:   Opened: 2004-12-13 07:45 0000
Hi,
the bug described at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=135337
also applies to gentoo.

this is with gnome-vfs-2.8.3-r1, gamin-0.0.19 instead of fam, hal-0.4.2 and happens on x86 and ppc

CDs work without problems

Bye

------- Comment #1 From Sebastian Dröge 2004-12-13 07:56:10 0000 -------
btw... it works the same way with fam instead of gamin
so maybe it's a bug in gamin or a bug in gnome-vfs which only shows up with gamin...

------- Comment #2 From foser (RETIRED) 2004-12-22 09:34:43 0000 -------
the bug you reference to should be solved in gnome-vfs-2.8.3

it could still be notification, do you use an inotify enabled kernel ? (you should always provide your emerge info in bugreports!)

------- Comment #3 From Sebastian Dröge 2004-12-22 09:44:06 0000 -------
it isn't solved in 2.8.3 for me... I'm using gamin over the inotify kernel
interface

With fam (using simple polls) everything works as expected

here's emerge info, but I don't think you can do sth usefull with it... it's
from the x86 box:

Portage 2.0.51-r8 (default-linux/x86/2004.3, gcc-3.4.3,
glibc-2.3.4.20041102-r0,
 2.6.9-gentoo-r10 i686)
=================================================================
System uname: 2.6.9-gentoo-r10 i686 AMD Athlon(TM) XP 2600+
Gentoo Base System version 1.6.8
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Oct 14 2004, 02:13:12)]
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[disable
d]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.3
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r2
virtual/os-headers:  2.6.8.1-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -mfpmath=sse,387 -momit-leaf-frame-pointer -O3
-fomit-f
rame-pointer -fprefetch-loop-arrays -fforce-addr -fmerge-all-constants -ftracer 
-funit-at-a-time -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/s
hare/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dv
ipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config
/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -mfpmath=sse,387 -momit-leaf-frame-pointer -O3
-fomit
-frame-pointer -fprefetch-loop-arrays -fforce-addr -fmerge-all-constants
-ftrace
r -funit-at-a-time -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo
http://ftp.belnet.
be/mirror/rsync.gentoo.org/gentoo/ http://gentoo.osuosl.org
http://www.ibiblio.o
rg/pub/Linux/distributions/gentoo"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aac aalib accessibility acpi alsa audiofile avi berkdb
bitmap
-fonts bonobo bzlib caps cddb cdr chroot crypt curl devmap dga dnd dv dvd
encode
 ethereal expat ext-png ext-zlib f77 faad fam ffmpeg fftw flac flash foomaticdb 
fortran freetype gcj gd gd-external gdbm gif gmp gnome gpm gstreamer gtk gtk2
gt
khtml guile hal imagemagick imap imlib imlib2 jack java javascript jpeg junit
la
dcca lcms ldap libg++ libgda libsamplerate libwww live lzw-tiff mad matroska
mbo
x md5sum mmap mmx mng monkey motif mozilla moznocompose moznoirc moznomail
mozp3
p mpeg mpeg4 mpi mplayer native ncurses nls nocardbus nptl nptlonly objc
oggvorb
is openal opengl oss pam parse-clocks pcre pdflib perl pic png pthreads python
q
uicktime radeon readline real ruby samba sasl sdl slang sndfile sox speex spell 
sse ssl svg szip t1lib tcltk tcpd tetex theora tiff transcode truetype type1
uni
code usb userlocales vim-with-x wmf wxwindows x86 xgetdefault xinerama xml xml2 
xprint xrandr xv xvid yv12 zlib"

------- Comment #4 From B. Keroack 2004-12-26 11:27:33 0000 -------
This bug also affects me. FWIW this bug was not present in GNOME 2.8.0 but
appeared after upgrading to stable 2.8.1. I'm using gamin with the inotify
backend.

Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.4.3,
glibc-2.3.4.20040808-r1, 2.6.9-gentoo-r9 i686)
=================================================================
System uname: 2.6.9-gentoo-r9 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers: 
sys-kernel/linux26-headers-2.6.8.1,sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -mfpmath=sse"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms userpriv
usersandbox"
GENTOO_MIRRORS="http://mirrors.acm.cs.rpi.edu/gentoo
http://mirrors.tds.net/gentoo
http://mirror.clarkson.edu/pub/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X aac acl acpi alsa avi berkdb bitmap-fonts cdr crypt cups eds
encode faad flac foomaticdb gdbm gif gnome gtk gtk2 hal imagemagick imlib ipv6
jpeg junit libwww mad mikmod mmap motif mozilla mpeg ncurses nptl offensive
oggvorbis opengl pam pda pdflib perl png ppds python quicktime readline real
sdl slang spell sse ssl svga tcpd tiff truetype xml xml2 xmms xv zlib"

------- Comment #5 From foser (RETIRED) 2004-12-28 06:55:44 0000 -------
what i'd like to see is testing with a newer inotify version before further
looking into this, this should be in 2.6.10 when it hits the streets.

------- Comment #6 From Sebastian Dröge 2004-12-28 07:51:33 0000 -------
it's the same with gentoo-dev-sources-2.6.10-r1 (which include the newest
inotify version)

------- Comment #7 From foser (RETIRED) 2005-01-06 04:05:25 0000 -------
well, then we go to manual labor. run hal in debugging mode, see if it detects
the adds & removes of the stick. run gvm in a terminal to see what it picks up
and how it handles it.

------- Comment #8 From Andreas Proschofsky 2005-01-08 09:17:05 0000 -------
Can confirm this problem  here with latest gnome / gamin / hal / kernel 2.6.10
+ inotify on ~x86

@foser: Everything gets picked up correctly by hal, the device (in this case a
memstick) even gets mounted correctly by gnome-volume-manager:

manager.c/711: New Device:
/org/freedesktop/Hal/devices/usb_usb_device_5dc_80_1_-1_B228472003050_0
libhal.c 911 : Error sending msg: No property info.capabilities on device with
id /org/freedesktop/Hal/devices/usb_usb_device_5dc_80_1_-1_B228472003050_0
libhal.c 911 : Error sending msg: No property info.capabilities on device with
id /org/freedesktop/Hal/devices/usb_usb_device_5dc_80_1_-1_B228472003050_0
manager.c/711: New Device: /org/freedesktop/Hal/devices/scsi_host_3
manager.c/711: New Device: /org/freedesktop/Hal/devices/scsi_3_0_0_0
libhal.c 911 : Error sending msg: No property info.capabilities on device with
id /org/freedesktop/Hal/devices/scsi_3_0_0_0
libhal.c 911 : Error sending msg: No property info.capabilities on device with
id /org/freedesktop/Hal/devices/scsi_3_0_0_0
manager.c/711: New Device: /org/freedesktop/Hal/devices/block_8_0
manager.c/711: New Device: /org/freedesktop/Hal/devices/block_18AF-B893
manager.c/747: Changed: /dev/sda1
manager.c/691: Added: /dev/sda1
manager.c/826: Mounted: /org/freedesktop/Hal/devices/block_18AF-B893

Just the corresponding icon is not displayed, neither on the desktop nor in the
computer:/// view. As pointed out in the red hat bug report it works correctly
once, but does not if you try again.

------- Comment #9 From Andreas Proschofsky 2005-01-08 09:46:18 0000 -------
Just a bit more of information: After killing the /usr/libexec/gam_server
process it works again (for one time).

Also unfortunately gamin-0.0.20 does not seem to solve that problem :(

------- Comment #10 From foser (RETIRED) 2005-01-08 11:56:23 0000 -------
i cannot test this here right now I'm afraid. Check and see if it's the
original referenced problem where mtab gets updated too fast and doesn't show
in gnome-vfs/gamin (you can run gamin in debug mode, check it's docs/homepage).

------- Comment #11 From B. Keroack 2005-03-13 15:48:02 0000 -------
This bug still exists with GNOME 2.10, gamin 0.0.20 and kernel 2.6.10-gentoo-r6

------- Comment #12 From foser (RETIRED) 2005-03-14 00:37:29 0000 -------
'me too's' are not interesting, just CC if you are on of them. Answering my
questions is.

------- Comment #13 From foser (RETIRED) 2005-03-14 01:57:19 0000 -------
*** Bug 85179 has been marked as a duplicate of this bug. ***

------- Comment #14 From aethyr 2005-03-14 12:38:34 0000 -------
Based on what I read here:
http://mail.gnome.org/archives/gamin-list/2005-March/msg00017.html

I changed the ebuild to disable the inotify backend and enable the dnotify backend:
        econf \
                --enable-dnotify \
                --disable-inotify \
                `use_enable debug` \
                `use_enable debug debug-api` \
                || die

Everything works fine now (except media still won't eject when I physically press the eject button on the drive, but I think that's a different bug).

------- Comment #15 From Martin Schlemmer (RETIRED) 2005-03-15 23:52:57 0000 -------
Foser, I tried quick to add some g_warnings in places, but it really looks as
if /etc/{fstab,mtab} is not monitored (monitors are added, but changes not
seen), or I have a illusion about what g_warning do.  I also checked if the
monitors added fails, but that is not the case.

I guess we, John (that originally did the inotify backend) or somebody else
should really look into updating the backend to use poll as well, like the
dnotify one does ... not sure if it will help, but .... ?

For those that still struggle with this issue, this is what I started to do a
while back already:

----
nosferatu gnome-vfs-2.10.0 # cat /etc/udev/rules.d/45-usbfd.rules
BUS="usb", KERNEL="ub[a-z]*", NAME="usbfd%n"
nosferatu gnome-vfs-2.10.0 # grep usbfd /etc/fstab
#/dev/sdd1           /mnt/usbfd      auto        noauto,user         0 0
/dev/usbfd1         /mnt/usbfd      vfat        noauto,user         0 0
nosferatu gnome-vfs-2.10.0 #
----

Basically I use the ub driver, so any flash I put in gets assigned the
/dev/usbfd1 node, and with the static entry in fstab, I can then just click on
the drive already added (I dont normally get it to automount, as that is
irritating).

------- Comment #16 From Martin Schlemmer (RETIRED) 2005-03-16 01:11:13 0000 -------
Urk, forget the last bit I said - used to rename sd? to usbfd when still using
the usb-storage driver.

------- Comment #17 From gad.kadosh@gmail.com 2005-03-20 03:02:04 0000 -------
I have the same problem (gnome-2.10, inotify-0.20, gamin-0.0.26). Is this not
caused by the default polling of /mnt and /media? see:
http://www.gnome.org/~veillard/gamin/config.html

------- Comment #18 From Martin Schlemmer (RETIRED) 2005-04-03 15:24:05 0000 -------
Tried it here, but no sigar - anybody else tried it?

-----
$ cat .gaminrc
notify /mnt/* /media/*


------- Comment #19 From Martin Schlemmer (RETIRED) 2005-04-03 15:26:39 0000 -------
PS: I can see why it might be an issue - the inotify backend still cannot use
polling as well (as the dnotify one can) ...

------- Comment #20 From foser (RETIRED) 2005-04-04 04:01:32 0000 -------
My theory still is that it has nothing todo with the polling of /mnt or /media,
but that updates to {fs,m}tab do not get noticed by gnome-vfs.

------- Comment #21 From Andreas Proschofsky 2005-04-07 05:15:31 0000 -------
There is a patch in Gnome Bugzilla which solves that problem for me:

http://bugzilla.gnome.org/show_bug.cgi?id=171201

This has also been applied upstream now and will be in the next release of gamin

------- Comment #22 From Cyril Jaquier 2005-04-11 15:31:10 0000 -------
I can confirm that the CVS version (20050412) of Gamin solves this problem :)
I'm using Gnome 2.10 and inotify-0.21.

------- Comment #23 From Daniel Drake 2005-04-21 15:30:28 0000 -------
The final patch posted in the gnome bug can't be backported easily. Should we
do a CVS snapshot?

------- Comment #24 From Daniel Drake 2005-05-09 17:35:48 0000 -------
Need some testers for the CVS snapshot idea. Please leave feedback at:
http://www.reactivated.net/weblog/archives/2005/05/sorting-out-gamin-brokenness-testers-needed/

------- Comment #25 From Giacomo Perale 2005-05-10 02:21:35 0000 -------
there are known problems in current gamin CVS, please check this gnome bug:
http://bugzilla.gnome.org/show_bug.cgi?id=171201

------- Comment #26 From Didier Link 2005-06-17 23:20:56 0000 -------
Seem's to work fine in ~amd64 (gnome-2.10) and gamin-0.1.1 released the 10 of
june. Need to be tested on other platforms.

Please update the ebuild tree ?


------- Comment #27 From Daniel Drake 2005-06-19 08:36:35 0000 -------
gamin 0.1.1 is now in portage, and has an inotify fix applied on top of that.
Please post here if issues still exist when running against gentoo-sources-2.6.12

------- Comment #28 From B. Keroack 2005-06-25 20:06:20 0000 -------
I haven't done stress testing but gamin-0.1.1 plus gentoo-sources-2.6.12-r1
seems to fix the issue so far.

------- Comment #29 From Gen Zhang 2005-07-04 01:37:42 0000 -------
gamin 0.1.1 and a repatched 2.6.11-r11 gentoo kernel works fine.

------- Comment #30 From Martin Schlemmer (RETIRED) 2005-07-04 12:57:25 0000 -------
Can confirm that newer works fine.