Sorting out gamin brokenness: Testers needed

EDIT: Removed links as this is now fixed upstream and in portage

So, many of us enjoy GNOME’s super-efficient integration with inotify via gamin and hal, which allows nautilus to show file updates in real-time, as well as file browsers automatically opening when a CD is inserted, or usb stick is plugged in, etc.

However, the above has been a bit broken for a while. Gentoo Bug 74285 has the details – basically, the media change notification stuff sometimes works once if at all, but then never again in that session.

The fix is a total rewrite of the inotify backend inside gamin. Unfortunately, due to major changes in gamin cvs, this isn’t easy to backport into the latest release (0.0.26). So it looks like using a CVS snapshot of gamin may be in order.

The plan is to test out the CVS snapshot that I have produced, which will then be added to portage when Linux 2.6.12 is released, assuming we don’t find any big bugs in the snapshot.

I’ve produced a gamin snapshot(link removed) from GNOME developer CVS as of right now, with patches from GNOME Bug 303612 and GNOME Bug 303615 applied.

If you are a GNOME+gamin+hal+inotify user, here’s what you can do to help test this:

  1. Get the snapshot ebuild from (link removed) and put it in your overlay directory under app-admin
  2. emerge the snapshot ebuild:
    # emerge --digest =gamin-0.0.26.20050510
  3. Patch your kernel with inotify 0.23-7. This will involve first reverting the inotify patch included in gentoo-sources-2.6.11 which can be found here. Note that this is the inotify included with 2.6.11-r7 and 2.6.11-r8. If you are using an older version, now would be a good time to upgrade. You can then patch with inotify 0.23-7 which can be found here:
    # cd /usr/src/linux
    ##download the patches
    # patch -p1 -R -i 4800_inotify-0.22-3.patch
    # patch -p1 -i inotify-0.23-rml-2.6.12-rc3-7.patch
    
  4. Recompile and reinstall your kernel in the usual way
  5. Reboot, start GNOME, and you are done.

To test it, open nautilus on your home directory. Then open a terminal, with both windows visible on screen. In the terminal, create/rename/delete some files, and ensure that nautilus is updated in real-time.
Next, insert a cdrom, and make sure that an icon appears for it on the desktop and the computer:// display is also updated. Use the icon to eject the cdrom, then put it back in again. Check that the icon reappears and computer:// is also updated again. Feel free to do the same with any USB storage you have to hand.

Please leave feedback here – even if it works perfectly! If we get enough testing, we’ll be able to finally solve this.

29 Responses to “Sorting out gamin brokenness: Testers needed”

  1. steev Says:

    Does this apply to the newly released gentoo-sources? I mean, I am about to test (im on dialup so about is a very general term) but I am just curious – I am using mm-sources at the moment, and when I unplug my usb drive, I can’t plug it back in, so I will definately be testing this.

  2. steev Says:

    by can’t plug it back in – i meant, when i plug it back in, i get told that /dev/sda1 does not exist.

  3. steev Says:

    I cannot download the gamin snapshot – is it at a different url than in the ebuild?

  4. steev Says:

    Initial reactions – CD in and out works fine – creates icon on desktop no problem.

    Usb hard drive – upon pulling the plug on it – rather, unplugging it from the laptop, i get the following in dmesg (sorry its so long)
    usb 1-1: USB disconnect, address 2
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19096) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19097) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19098) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19099) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19100) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19101) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19102) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19103) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19104) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19105) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19106) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19107) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19108) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19109) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19110) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19111) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19112) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19113) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19114) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19115) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19116) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19117) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19118) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19119) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19120) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19121) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19122) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19123) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19124) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19125) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19126) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT: Directory bread(block 19127) failed
    scsi0 (0:0): rejecting I/O to dead device
    FAT bread failed in fat_clusters_flush

    Plugging it back in however – I get the icon back on my desktop (THANK YOU!!!)

    And then again, upon removing the plug, i only get the FAT bread failed in fat_clusters_flush one time – and upon plugging it back in… I don’t get the icon back, however, it IS mounted – opening up computer:// shows it – and clicking on it gives an error that its already mounted, and the icon returns.

    Nautilus is showing updates in real time as well.

    Vendor: TOSHIBA Model: MK2004GAL Rev: JC10
    Type: Direct-Access ANSI SCSI revision: 02
    SCSI device sda: 39063024 512-byte hdwr sectors (20000 MB)
    sda: assuming drive cache: write through
    SCSI device sda: 39063024 512-byte hdwr sectors (20000 MB)
    sda: assuming drive cache: write through
    sda: sda1
    Attached scsi disk sda at scsi3, channel 0, id 0, lun 0
    Attached scsi generic sg0 at scsi3, channel 0, id 0, lun 0, type 0
    usb-storage: device scan complete

    that is what shows up in dmesg upon insertion but not getting the icon on the desktop. (if i unmount the volume, and then pull the plug, no FAT bread messages in dmesg.

    A few more unmounts and mounts, and the icon returns to the desktop – its rather spurious.

  5. steev Says:

    And Nautilus updates in real time as well (that was part of my last comment – but didn’t get in there for some reason)

    I am using the -r7 release of gentoo-sources, and will be bumping up to -r8 in a minute here.

  6. steev Says:

    Same thing with -r8 – nautilus is working fine, same with cdrom – simply unmounting and mounting the usb drive works – but if i unplug/plug back in – sometimes it works, sometimes it doesn’t – im thinking that is more of a usb issue, as my usb wireless card if I unplug it, locks up my keyboard, so I’d say this is working in my book.

  7. Cardoe Says:

    Exactly the fixes we need. Tracking this in the Gentopia Project as well. As well as sticking it with our overlay to get you more testers.

    https://dev.cardoe.com/gentopia/
    http://dev.gentoo.org/~cardoe/utopia/

  8. Cardoe Says:

    Well the nautilus test doesn’t work for me… CD-ROM works. but pulling out the USB disk still leaves a relic. in df -h

    /dev/sda1 62M 16M 46M 27% /media/USB MEMORY
    df: `/media/USB MEMORY-1′: Input/output error

  9. Giacomo Says:

    As you can read in Gnome Bugzilla (http://bugzilla.gnome.org/show_bug.cgi?id=171201) current gamin CVS still has problems. Since both John McCutchan and Daniel Veillard commented in that bug in the last hours, maybe best thing would be report significant testing information to them and wait for a fix. Alternatively you can:

    * use inotify 0.22 with a gamin snapshot dated between 15 and 30 april: I did this for 2 weeks without major problems
    * change gamin ebuild to use dnotify support in current CVS

  10. fuoco Says:

    Odd, but for me it works OK so far.

  11. dsd Says:

    It’s working fine for me, except for my USB compactflash reader. It only mounts the first time I plug it in. I guess this is unrelated – probably a HAL issue – has anyone heard of this?

    CDROMs, saving files to desktop, etc, is working just fine.

    Giacomo: There appears to be some confusion on that bug about inotify versions etc. Are you able to reproduce any of those problems after following the procedure I posted here?

  12. lotso Says:

    The Gentopia URL is wrong. it’s supposed to be utopia instead of gentopia.

    http://dev.gentoo.org/~cardoe/utopia/

    or

    https://dev.cardoe.com/gentopia/

    .com and not .org

    [modified cardoe's earlier post. thanks, --dsd]

  13. lotso Says:

    Dude.. This rocks. I just tested out the gamin on 2.6.11-suspend2 kernel (from brix’s overlay) and I patched with the newe inotify patch and it works.

    The xterm and nautilus trick worked in real-time. There’s no more need for me to press Ctrl-R each time for updates. (I don’t run famd because I don’t like portmapper being turned on)

    I’ve yet to try out the cdrom thingy because i took my cdrom out of my laptop’s modular bay.

    ps: You’re welcomed

  14. Cardoe Says:

    Using Gentopia’s Revision 31 Repository (latest as of now) everything works 100% for me.

    xterm+nautilus, cdrom, and USB… can plug it in and out as many times as you want.

    Thanks dsd.

  15. lotso Says:

    Cardoe, I use your repo as well and I have to ask, it’s really necessary to have installed gnome-volume-manager to actually have things working right??

    BTW, do I use the one on your repo or will the one in portage work as well??

  16. lotso Says:

    Ok. I just tested it with gnome-volume-manager 1.3.1 and USB stick, I kept getting this in hald verbose messages.

    18764: 23:24:16.296: addon-storage.c:282: open failed for /dev/sda: Permission denied

    ls -l /dev/sd* (These are automatically created when I plug it in)
    brw-rw—- 1 root disk 8, 0 May 11 23:19 /dev/sda
    brw-rw—- 1 root disk 8, 1 May 11 23:19 /dev/sda1

    id
    uid=500(gentoo) gid=100(users) groups=6(disk),10(wheel),18(audio),19(cdrom),32(gdm),35(games),100(users),250(portage)

  17. lotso Says:

    Okay.. Perhaps this isn’t the place to be asking or making so many comments.. But if you could either reply or let me know where to fill the bug report it would be great too.

    1. found out HAL needs to be run using –retain-privileges for it to be able to automatically create the /etc/fstab file and not get the error message

    2. Due to #1 above, the init script which I found on gnome-base/hal won’t work because it doesn’t have the –retain-priviledges option. (Though It would be an easy hack to add it in)

    3. Gnome-volume-manager breaks of sorts. When I plug in the USB, it will get automatically detected. Nautilus will show it up as the “USB Drive” and put an icon there automatically. UDEV Creates /dev/sd[a1], However, it won’t automatically mount nor wil it automatically browse (should be implied anyway).

    What appears in the messages are these few lines :

    (gnome-volume-manager:20902): WARNING **: manager.c/506: failed to exec /usr/bin/pmount-hal: Failed to execute child process “/usr/bin/pmount-hal” (No such file or directory)

    ** (gnome-volume-manager:20902): WARNING **: manager.c/507: trying /bin/mount…
    mount: can’t find /org/freedesktop/Hal/devices/volume_part1_size_128848896 in /etc/fstab or /etc/mtab

    I’m gonna be watching this Comment Space via RSS.

    Please Comment.

  18. Giacomo Says:

    Yesterday I recompiled last 2.6.11 ck kernel with inotify 0.23-7 and upgraded gamin to this cvs snapshot. This fixed most problem, except the Desktop upgrading. Also I discovered that I can trigger the bug with a simple bash line:

    while true; do echo “aaaaaaaaaaa” > ~/Desktop/aaa.txt; sleep 5; rm ~/Desktop/aaa.txt; sleep 5; done

    after a while (I can’t tell how many cycles, I’ll repeat the test later) Desktop is not updated, and mounted media don’t appear anymore, until I close and reload X.
    This bug doesn’t occur if I create and remove the file in my home directory.

  19. lotso Says:

    Okay.. seems like I’m the predominant commenter in this space.. Oh well.. as long as these are all logged into Google, ppl will be able to find it.

    After some googling and going through links in gentoo bugzilla as well as re-syncing with cardoe’s overlay (which is down right now) I finally managed to get the thing to work. I just emerged pmount from Project Gentopia’s Overlay and it works.

    I’m using pmount-0.9 because for some reason the one fetched from http://dev.gentoo.org/~npmccallum/ is sort of Bad(?) since the manifest md5sum is wrong.

    Right now. everything works. Just need to put this into the startup script for hald (diff to the script already in portage)

    — /usr/portage/sys-apps/hal/files/hald 2004-09-28 10:12:32.000000000 +0800
    +++ /etc/init.d/hald 2005-05-12 01:13:13.000000000 +0800
    @@ -13,7 +13,7 @@

    ebegin “Starting Hardware Abstraction Layer daemon”

    - start-stop-daemon –start -q –exec /usr/sbin/hald
    + start-stop-daemon –start -q –exec /usr/sbin/hald — –retain-privileges

    eend $?

    Giacomo:

    I tested your bug with this

    for i in `seq 1 2000`; do echo $i; echo “aaaaaaaaaaa� > ~/Desktop/aaa.txt; sleep 5; rm ~/Desktop/aaa.txt; sleep 5; done

    it’s now in iteration 65 and still it’s OK.

  20. Giacomo Says:

    I just tested again, and it failed between 300 and 330 iteration.

  21. Roel Says:

    I’m trying this together with Gentopia. Gamin seems to work with the patched kernel (hey!), but now only File System is shown under Computer. And USB sticks are not automounted with a link on my desktop.

    @lotso, regarding your ‘fix’ to hald, I am under the impression that –retain-privileges is not meant for that:

    [quote]+ ” –retain-privileges Run as normal user instead of root (calling of\n”
    + ” external scripts to modify fstab etc. will not work\n”
    + ” run as root)\n”[/quote]
    (source: http://lists.freedesktop.org/archives/hal-commit/2005-February/000987.html )

  22. Giacomo Says:

    oh, well, it seems that there is a new upstream release, 20050510 snapshot + two fixes. I’m going to update my overlay.

  23. lotso Says:

    Roel… I finally figured it out on why it might/might not work. The –retain-privileges was suggested to me by David Z (Freedesktop/hal) and once I did that it worked.

    I believe that there’s 2 things which I missed or overlooked.

    fstab-sync and pmount.

    Pmount, right now works and automatically mounts my USB.

    Since I deleted all references of /dev/sda[12345] in my fstab that may be the issue why it doesn’t automount.

    I’m not entirely sure since I stopped playing with it now.

  24. dsd Says:

    Giacomo: Where? I don’t see it. But it sounds suspiciously like the one I blogged about here, which was made on the same date and contains two fixes…

  25. Giacomo Says:

    http://www.gnome.org/~veillard/gamin/news.html

  26. pharon Says:

    the bug is also here : http://bugzilla.gnome.org/show_bug.cgi?id=171201

    Well I think the gamin-inotify issue is finally fixed. Eventually the fixes will be accepted upstream and distros will use recent kernels with newer inotify version. Thanks for your efforts.

    Now please, we need a similar effort to tackle the problems created by new dbus and hal , I am aware of project gentopia but it is currently lacking a lot of instructions.

  27. dsd’s weblog » Blog Archive » Gamin 0.1.0 Says:

    [...] amin 0.1.0 Gamin 0.1.0 was released on Thursday. It’s very similar to the testing snapshot that I produced, but has a coupl [...]

  28. lotso Says:

    Dude.. there’s something fishy here with inotify, Each time I shutdown my machine (I ususally do hibernate using suspend2) the kernel will oops with a pointer to the umount as well as showing inotify_umount.

    I don’t have a log of it unless I manually copy it down.

    Anyone else seen this?

  29. Joshua Says:

    I am having problems getting hald/dbus/whatever to pick up my hotplug USB devices. This is kinda wierd. Any pointers on what to do next?

Leave a Reply

You must be logged in to post a comment.