Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Automounting in userspace with ivman
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 15, 16, 17 ... 27, 28, 29  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Sat Dec 18, 2004 11:42 pm    Post subject: Reply with quote

Till Varoquaux - Ivman considers something mountable if HAL says that it should be mounted; you can see from these two lines:

Code:
libhal.c 1134 : Error sending msg: No property volume.policy.should_mount on device with id /org/freedesktop/Hal/devices/block_SMC7204BRA
libhal.c 1134 : Error sending msg: No property storage.policy.should_mount on device with id /org/freedesktop/Hal/devices/block_22_0


...that HAL doesn't specify that it should be mounted. Are you using HAL 0.4.2? If not, I suggest upgrading to it; if you are using 0.4.2 and it's still not working, could you please post the contents of /usr/share/hal/fdi/90defaultpolicy/storage-policy.fdi?

hoegg - OK, now I am really confused, your lshal output shows the disc as being iso9660, so why should it be affected by a UDF option? Hmm. Well, for now, just keep it commented so it works :-) If the permissions are such that non-root can read it anyway, then that UDF option was never even needed.

I happen to be acquiring a laptop with a DVD drive during this Christmas period (lucky me!), after which I'll try to get to the bottom of this. In the long run it might be necessary to make some special rule to handle devices where volume.disc.type = 'dvd_rom' (since they seem so weird...)


Last edited by rohan28 on Sun Dec 19, 2004 4:39 am; edited 1 time in total
Back to top
View user's profile Send private message
Till Varoquaux
n00b
n00b


Joined: 28 Oct 2004
Posts: 24

PostPosted: Sun Dec 19, 2004 3:39 am    Post subject: Fixed Reply with quote

Ok, I upgraded to the cvs build for hald and everything is up and running.
Thanks a bunch rohan28 .... That was a great of a great help.
Back to top
View user's profile Send private message
Genn
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2003
Posts: 98

PostPosted: Sun Dec 19, 2004 6:30 am    Post subject: Reply with quote

Very cool, I just got everything working. I had to turn off fstab-sync because it was somehow breaking my mount command, and a I had to stop ivman from mounting my boot partition, but other then that it went fine. Good job! I'm looking forward to future updates.
Back to top
View user's profile Send private message
cbr
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 285
Location: Tallinn/Rakvere, Estonia

PostPosted: Sun Dec 19, 2004 2:33 pm    Post subject: Reply with quote

cbr wrote:
I have a problem that i have always had with ivman. It mounts great, everything is nice BUT when i press the CDROM eject button, it doesnt unmount the CD. It still stays in 'mount' although the CD has ejected. Is there a solution to this?

*bump*
Back to top
View user's profile Send private message
genstef
Retired Dev
Retired Dev


Joined: 13 Jun 2004
Posts: 668
Location: M/Bay/Germany

PostPosted: Sun Dec 19, 2004 4:08 pm    Post subject: Reply with quote

cbr:
genstef wrote:
Problems with eject were common in the "-cvs" ebuilds that were not made by me, because you can setup ivman to run as user there, which basically breaks unlocking.
I think there is also a simple explanation for the video-dvd problem. The player locks the drive again when ivman has unlocked it, so you cant eject it.


Do you use the -cvs version ebuild?
Back to top
View user's profile Send private message
cbr
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 285
Location: Tallinn/Rakvere, Estonia

PostPosted: Sun Dec 19, 2004 9:10 pm    Post subject: Reply with quote

I used to use them. (ones from fluidportage) but even then i didnt use the user option. And now i'm using the version in portage and still have the problem.
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Sun Dec 19, 2004 10:17 pm    Post subject: Reply with quote

Hmm, that is troubling. So, you say the CD ejects, but does not unmount? On my system, ejecting a mounted CD forces it to unmount on a lower level than Ivman (at kernel level, I think). I'm going over the 'eject' code anyway and trying to make it more robust, hopefully solving your problem in the process, but in the meantime... what kernel are you using? What version of HAL? Can you please show Ivman output when ejecting a CD? Thanks :-)
Back to top
View user's profile Send private message
Q-collective
Advocate
Advocate


Joined: 22 Mar 2004
Posts: 2056

PostPosted: Mon Dec 20, 2004 12:59 am    Post subject: Reply with quote

So, can you mount an usb stick with it these days? Or should I still use Gnome-Volume-Manager?
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Mon Dec 20, 2004 1:06 am    Post subject: Reply with quote

Yes, USB sticks and hard drives are now supported. That being said, if gnome-volume-manager works and you don't need to automount devices without being logged in to Gnome, then you may as well stick with it :-)
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Tue Dec 21, 2004 1:00 am    Post subject: Reply with quote

cbr: have you ever had any other troubles with your CD drive? At the moment, it's looking as though your drive simply might be 'weird' :-) Apparently there is no simple solution to the 'eject' problem; there exists a specification for CD drives to send a message to the OS when the eject button is pressed, but practically no CD drives do this (although Ivman does (attempt to) handle it).

So what happens in general for drives which do not support that feature (i.e. 99% of drives), is that Ivman unlocks the drive as soon as the CD is put in, and when you hit eject, the kernel (I think) is forced to unmount any filesystem on the CD. It's the same thing as just yanking out a USB stick.

If the CD ejects but the filesystem isn't being unmounted for you, then as far as I can see, there is probably either something wrong with your kernel, or something weird with your CD drive. I guess another possibility is that some program is continually trying to access the mounted filesystem, and your system is attempting to unmount the fs 'lazily', which means it doesn't finish unmounting until all programs stop using it.

Have you had any other problems with your CD drive? What kernel are you running? Are there any programs on your system you can think of that might be messing up the unmount process?
Back to top
View user's profile Send private message
Arek75
n00b
n00b


Joined: 11 Nov 2004
Posts: 25

PostPosted: Tue Dec 21, 2004 6:27 am    Post subject: Reply with quote

I can't get DVD Autoplay to work - apparently, the DVD isn't being recognized as video. Here's ivman's debug output:
Code:
Ikke's Volume Manager, http://ivman.sf.net
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_22_0
hal_interface.c:40 (hal_device_added) New Device: /org/freedesktop/Hal/devices/block_HP_PRISONER_OF_AZKABAN_DISC1
libhal.c 1205 : Error sending msg: No property volume.policy.should_mount on device with id /org/freedesktop/Hal/devices/block_HP_PRISONER_OF_AZKABAN_DISC1
IvmConfigActions.c:55 (parseIvmConfigActions) /dev/hdc appears to be mountable
manager.c:202 (ivm_media_changed) Attempting to mount /dev/hdc
manager.c:167 (ivm_device_mount) Calling /bin/mount /dev/hdc (null) (null)
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_HP_PRISONER_OF_AZKABAN_DISC1
hal_interface.c:142 (hal_property_modified) Mounted: /org/freedesktop/Hal/devices/block_HP_PRISONER_OF_AZKABAN_DISC1
hal_interface.c:157 (hal_property_modified) Devices table has 1 entries
hal_interface.c:234 (print_device)      "/org/freedesktop/Hal/devices/block_HP_PRISONER_OF_AZKABAN_DISC1"        "/media/dvdrom"
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_HP_PRISONER_OF_AZKABAN_DISC1
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_HP_PRISONER_OF_AZKABAN_DISC1
hal_interface.c:208 (hal_device_condition) Event received but no action taken
 Name: VolumeMount


and the contents of /etc/ivman/IvmConfigActions.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ivm:ActionsConfig version="0.2" xmlns:ivm="http://www.eikke.com/ivm">

    <!-- syntax of this file:

         <ivm:Match name="matchname" value="matchvalue">
             <ivm:Option name="optionname1" value="optionvalue1" />
             <ivm:Option name="optionname2" value="optionvalue2" />
             ...
         </ivm:Match>

         Matches can be nested.  See the examples.

         Not implemented yet, but it is planned that if the tag has property
         invert="true", then it will only match if the given name is NOT
         equal to the given value.

         If a device matches multiple times and is given conflicting options,
         then the last options (closest to end of file) take precedence.
    -->

    <!-- names for Match:

         ivm.mountable (true/false) - a volume which can be mounted by ivman
         ivm.videodvd (true/false) - a DVD which contains video
                                     (NOT YET IMPLEMENTED)
         hal.anything (mixed) - the HAL property specified by 'anything'

         The hal.anything match is very powerful; see the examples in this
         file for some things which can be done.  Use the output of 'lshal'
         to come up with properties to match for certain devices.
    -->

    <!-- names for Option:
         mount (true/false) - mount the volume
         mountoption (string) - append the given mount option before mounting
         unlock (true/false) - unlock the tray (for CD/DVD drives etc)
         exec (string) - execute the given command
         execdvd (string) - execute the given command if the drive is a
                            DVD drive
         execun (string) - execute the given command when unmounting device
         execas (string) - execute the 'exec', 'execun' and 'execdvd' commands
                           with the privileges of this user

         For exec and execdvd, %d and %m will be replaced with the device
         and its mount point respectively.  %d, %m and execas are not
         supported for execun.  Full paths must be given for commands.

         A single device can have multiple mountoption and exec
         options; for all others, only the option closest to the end of the
         file will be used.
    -->


    <!-- unlock everything - harmless for devices without tray locking -->
    <ivm:Option name="unlock" value="true" />

    <!-- try to mount any mountable volume at all -->
    <ivm:Match name="ivm.mountable" value="true">
        <ivm:Option name="mount" value="true" />
    </ivm:Match>

    <!-- don't mount Jimmie's windows partition -->
    <ivm:Match name="volume.uuid" value="7C905036904FF4E4">
        <ivm:Option name="mount" value="false" />
    </ivm:Match>

    <!-- don't try to mount audio CDs -->
    <ivm:Match name="hal.volume.disc.has_audio" value="true">
        <ivm:Match name="hal.volume.disc.has_data" value="false">
            <ivm:Option name="mount" value="false" />
        </ivm:Match>
    </ivm:Match>

    <!-- mount some non-Linux filesystems read/write for everyone -->
    <ivm:Match name="hal.volume.fstype" value="vfat">
        <ivm:Option name="mountoption" value="umask=0000" />
    </ivm:Match>
    <ivm:Match name="hal.volume.fstype" value="ntfs">
        <ivm:Option name="mountoption" value="umask=0000" />
    </ivm:Match>
    <ivm:Match name="hal.volume.fstype" value="npfs">
        <ivm:Option name="mountoption" value="umask=0000" />
    </ivm:Match>
<!--  UDF apparently doesn't support umask.
    <ivm:Match name="hal.volume.fstype" value="udf">
        <ivm:Option name="mountoption" value="umask=0000" />
    </ivm:Match>
-->

    <!-- example - autoplay CDs with audio tracks and no data tracks -->
    <ivm:Match name="hal.volume.disc.type" value="cd_rom">
        <ivm:Match name="hal.volume.disc.has_audio" value="true">
            <ivm:Match name="hal.volume.disc.has_data" value="false">
                <ivm:Option name="unlock" value="false" />
                <ivm:Option name="exec" value='su `cat /etc/ivman/user` -c "xmms /dev/cdrom"' />
            </ivm:Match>
        </ivm:Match>
    </ivm:Match>

    <!-- example - autoplay video DVDs -->
    <!-- video DVD detection is an ugly hack at the moment, because it's not
         possible to tell if a DVD contains video without mounting it first.
         That's why we don't use a 'Match' to tell if a volume is a video
         DVD yet. -->
    <ivm:Option name="execdvd" value='su `cat /etc/ivman/user` -c "/usr/bin/ogle %d"' />
    <!-- Future Compatibility - current version doesn't like it, tho. -->
    <!--
    <ivm:Match name="ivm.videodvd" value="true">
        <ivm:Option name="exec" value='su `cat /etc/ivman/user` -c "/usr/bin/ogle %d"' />
    </ivm:Match>
    -->

    <!-- example - mount volume with UUID 4170-DC9F accessible only for
         user with UID 1000 -->
    <!--
    <ivm:Match name="hal.volume.uuid" value="4170-DC9F">
        <ivm:Option name="mountoption" value="umask=0077" />
        <ivm:Option name="mountoption" value="uid=1000" />
    </ivm:Match>
    -->


    <!-- example - don't mount /dev/camera -->
    <!--
    <ivm:Match name="hal.block.device" value="/dev/camera">
        <ivm:Option name="mount" value="false" />
    </ivm:Match>
    -->

    <!-- example - log whenever someone mounts or unmounts a device -->
    <!--
    <ivm:Match name="ivm.mountable" value="true">
        <ivm:Option name="exec" value="/bin/sh -c 'echo %d mounted at `date` >>/tmp/mounts'" />
        <ivm:Option name="execun" value="/bin/sh -c 'echo unmounted at `date` >> /tmp/mounts'" />
    </ivm:Match>
    -->

</ivm:ActionsConfig>


So far, mounting works (mounts as /media/dvdrom instead of /mnt/cdrom - a minor problem at best/worst), as does cd audio playing (any ideas for replacing su? I want to be able to allow *any* logged in user to autoplay audio cds and dvds, and I don't think I can use execas for that), but dvd playing doesn't, as the disc is apparently not recognized as a video dvd, and simply mounted.

Thank you for your time.

--Arek75
(james :AT: verge-rpg.com)
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Tue Dec 21, 2004 7:34 am    Post subject: Reply with quote

Jimmie: First, something that I can help you with :-) If you want to change the mount point, you can put your own entry in fstab (which is what I suggest for non-removable drives with removable media such as DVD/CD drives etc) and the mount point given there should be used by Ivman (it's best to use the real device nodes in fstab as opposed to symlinks, although in theory they should work as well if you put the relevant mapping in IvmConfigMappings.xml). In general, the creation of mount points is handled by HAL, with rules (assuming HAL 0.4.2, I suggest upgrading to this one if you're using an earlier version) in /usr/share/hal/fdi/90defaultpolicy/* (suggested that you copy this directory to /usr/share/hal/fdi/95userpolicy/ and just edit the copy). You're looking for the storage.policy.desired_mount_point options, I think you'll be able to figure out how to change it when you see it :-) If you're still using /mnt for removable media, you might want to consider migrating to /media, as that's what the newest FHS specifies.

Video DVD detection simply looks for the VIDEO_TS (or video_ts) directory in the root of the DVD. Does the DVD have this directory? I really don't know much about the video DVD format as I don't have a DVD drive, but I will soon, after which I will try to figure out a better way to detect video DVDs (hopefully there is a better way!).

I'm curious as to what you've done with your 'exec' values... I see you're running the commands as the user specified in /etc/ivman/user. You've set up something which writes the current user to /etc/ivman/user when starting up Gnome/KDE/whatever? If that's what it is, that's a pretty ingenious hack :-)

You're right, you can't use execas for that, execas can only be set to one specific user. I've thought about it a lot, and I can't see a simple solution to the user problem - several hacks have sprung to mind, like just using the most recently logged in user, but there are obvious problems with this. The only 'correct' way seems to be to run ivman as non-root, e.g., set it up to run when Gnome/KDE/etc are launched, but even this has problems, since Gnome supports multiple users and KDE will as of 3.4 (I think). Also, I don't know how well Ivman works as a non-root user.

In general, I would say that Ivman should be used for volume management and maybe running some important programs as root on mounting, but automatic CD/DVD playing stuff should really be left up to something running inside of a user's session in Gnome/KDE/etc. I don't know if such programs exist yet...

(btw I didn't know Verge was still around, I used to mess around with it years ago, SNES-style RPGs are the best :-))
Back to top
View user's profile Send private message
cbr
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 285
Location: Tallinn/Rakvere, Estonia

PostPosted: Tue Dec 21, 2004 1:46 pm    Post subject: Reply with quote

OK, here goes. The device on /dev/hdd is a Lite-On 48x/12x/48x CDRW. I have never had any problem with it. And this is the Ivman output for inserting and ejecting the CD:
Code:
# ivman
Ikke's Volume Manager, http://ivman.sf.net
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_22_64
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_22_64
hal_interface.c:40 (hal_device_added) New Device: /org/freedesktop/Hal/devices/block_TEARSOFTHESUNCD1
libhal.c 1205 : Error sending msg: No property volume.policy.should_mount on device with id /org/freedesktop/Hal/devices/block_TEARSOFTHESUNCD1
IvmConfigActions.c:55 (parseIvmConfigActions) /dev/hdd appears to be mountable
manager.c:202 (ivm_media_changed) Attempting to mount /dev/hdd
manager.c:146 (ivm_device_mount) Mapped to /dev/cdroms/cdrom1
manager.c:167 (ivm_device_mount) Calling /bin/mount /dev/cdroms/cdrom1 (null) (null)
mount: block device /dev/cdroms/cdrom1 is write-protected, mounting read-only
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_TEARSOFTHESUNCD1
hal_interface.c:142 (hal_property_modified) Mounted: /org/freedesktop/Hal/devices/block_TEARSOFTHESUNCD1
hal_interface.c:157 (hal_property_modified) Devices table has 1 entries
hal_interface.c:234 (print_device)      "/org/freedesktop/Hal/devices/block_TEARSOFTHESUNCD1"    "/mnt/cdrw"
hal_interface.c:133 (hal_property_modified) Property modified on device: /org/freedesktop/Hal/devices/block_TEARSOFTHESUNCD1
hal_interface.c:208 (hal_device_condition) Event received but no action taken
 Name: VolumeMount
Back to top
View user's profile Send private message
Arek75
n00b
n00b


Joined: 11 Nov 2004
Posts: 25

PostPosted: Tue Dec 21, 2004 2:36 pm    Post subject: Reply with quote

rohan28 wrote:

Video DVD detection simply looks for the VIDEO_TS (or video_ts) directory in the root of the DVD. Does the DVD have this directory? I really don't know much about the video DVD format as I don't have a DVD drive, but I will soon, after which I will try to figure out a better way to detect video DVDs (hopefully there is a better way!).

It's there.
Code:

ls /media/dvdrom
autorun.inf  common  disc.id  install.exe  jacket_p  readme.txt  video_ts  win

rohan28 wrote:

I'm curious as to what you've done with your 'exec' values... I see you're running the commands as the user specified in /etc/ivman/user. You've set up something which writes the current user to /etc/ivman/user when starting up Gnome/KDE/whatever? If that's what it is, that's a pretty ingenious hack :-)

That's exactly what I'm going to do. Haven't implemented writing to /etc/ivman/user yet, tho (probably ought to find a better place, among other things), and it still only supports one user logged in at a time.
rohan28 wrote:

In general, I would say that Ivman should be used for volume management and maybe running some important programs as root on mounting, but automatic CD/DVD playing stuff should really be left up to something running inside of a user's session in Gnome/KDE/etc. I don't know if such programs exist yet...

You know, I actually agree with you here, but I don't think any other software exists for doing this stuff right now (at least in a way supported by all desktops). GVM exists for gnome, and may do this, but that's gnome-specific. xmcd (and its command-line counterpart cda) exists as well, but that program "grabs" the cdrom in a way that prevents hal from working, and doesn't support dvds. Other than these, I don't know of any programs that support this yet, even partially, except for ivman itself. One solution would be to write some sort of light-weight client that could be run on log-in to run programs. Doing this, the program could listen for a special D-BUS message sent by ivman when cds/dvds/etc are detected/mounted and run a user-specified program to handle it.

rohan28 wrote:

(btw I didn't know Verge was still around, I used to mess around with it years ago, SNES-style RPGs are the best :-))

Yes, Verge still exists. :D As a matter of fact, Verge 3 was released earlier this year, and really kicks butt compared to Verge 2 (verge 1 is still king for ease-of-use, tho). I've been around the verge community for a looooong time (as James, then Arek), so given your old nick, I'd probably remember you. Unfortunately, V3 isn't available for linux, and probably never will be :(. For linux, I suggest looking into V1/V2 (builds [not ebuilds] exist of both) and/or ika (an offshoot of Verge that uses python for scripting).

Thanks for all your help. :D

--Arek75
(james@verge-rpg.com)

P.S. I'm James. My Sister's name is Jimmie I've got her HD in my computer right now because I need to back some stuff up on it then wipe it and reinstall window$ on her computer.
Back to top
View user's profile Send private message
keyson
l33t
l33t


Joined: 10 Jun 2003
Posts: 829
Location: Sweden

PostPosted: Tue Dec 21, 2004 9:43 pm    Post subject: Reply with quote

Hi all,

Nice things this udev g-bus hal ivman. Starts to look realy good.

Tryed it out and found it werry configurable. But the readme
in the hal doc is telling a lie about tons of docs on the hal site.
I can't find it and some link is not working.
But no more whining about that, now to my question.

I have used udev (no tar) for some time and autofs and other
scripts to get my usb stick to mount and unmount with success.
So now i hade a go whit this things. And it works ----

To get it to always use the right dev to mount i made a
symlink called 'stick'. So when i plug it in it's /dev/stick.
This is due to the fakt that it may change from sda to
sdb and sdc ....

Quote:
BUS="usb", SYSFS{serial}="0734023200E7", NAME="%k", SYMLINK="stick"


Now using ivman it mount as /dev/sda don't care about the symlink.
So when it changes it make a new mountpoint and so on.

Read as many postings an manuals i could found and tested to
name it in udev rules to stick. Then hal and ivman get hang.

Hal reports 'sda' but the device created is 'stick' so it f..k's tings up.

So i suppose i have to get hal to report stick for my usbstick so
ivman is mounting the /dev/stick that udev is creating on /media/usbdrive.

But where can i get info about the xml for hal to write the right rule ?

Phuuu, that was a long question.

/Kjell
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Tue Dec 21, 2004 10:36 pm    Post subject: Reply with quote

keyson: I'd recommend switching around your symlink and device name; i.e., change it to read
Code:
BUS="usb", SYSFS{serial}="0734023200E7", NAME="stick%n", SYMLINK="%k"

(by the way, I'm not 100% sure this rule will even work, as the serial number might just be set for the main device and not the volumes on it, so your stick might be called 'stick' but the volumes still 'sdb1, sdb2' etc.)
HAL always passes the real device name, rather than any symlinks, to Ivman, which means you need to mess around with the IvmConfigMappings.xml file to get things to work if your fstab entry isn't for the real device. It's much cleaner to actually use the real device to mount. If you really don't want to do that, then you need to put an entry in IvmConfigMappings.xml - you can probably figure it out from the example there.
By the way, I have also noticed that if you mess around with UDEV rules without restarting the system, sometimes HAL will hang. The best way to prevent this is, don't mess around with UDEV rules while HAL is running :-)

james: Hmm, I am really puzzled as to why that DVD isn't being detected. Can't really do much more testing just yet, though :-) By the way, I just had a thought. It's possible to run Ivman twice (it doesn't grab devices exclusively like you say HAL does), so maybe we could have an original process running as root, and then have another process start up when logged in to Gnome/KDE which reads ~/.ivm/IvmConfigActions.xml or similar? This file would then contain 'exec' type options, but no 'mount' options. I think this is not such a bad idea. (btw, sorry, every guy I've ever met called 'James' always had the nickname 'Jimmy' :-))

cbr: I see you're using symlinks for the cdrom device. Could you please try editing your fstab entry and IvmConfigMappings.xml to just use hdd, then see if the problem persists? I have a hunch that it will, but it's worth looking at :-)
Back to top
View user's profile Send private message
keyson
l33t
l33t


Joined: 10 Jun 2003
Posts: 829
Location: Sweden

PostPosted: Tue Dec 21, 2004 11:01 pm    Post subject: Reply with quote

Tnx rohan28,

Why didn't i think of that. Now hal is not hanging and it reports
/dev/stick.

Don't use stick%n as it is handled like a mounable volume on
/dev/sda. The problem is that it is not sure it is sda. If i plug in someting
else, it can change to sdb or sdc. But if i use this udev rule, it's
always stick.

The line in the fstab is ok and i can mount and unmount.

So now i only have to fix up the rules for the ivman to make it automount.

/Kjell
Back to top
View user's profile Send private message
Arek75
n00b
n00b


Joined: 11 Nov 2004
Posts: 25

PostPosted: Wed Dec 22, 2004 2:48 am    Post subject: Reply with quote

Thanks for trying to help on the DVD, I'll do a little research over the next day or 2 and see what I can come up with. As for running ivman twice, all that's needed to do that is a way to specify where it can find its config files (ivman --config=$HOME/.ivman), and I think it'd work.

--Arek75
(james@verge-rpg.com)
Back to top
View user's profile Send private message
cbr
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 285
Location: Tallinn/Rakvere, Estonia

PostPosted: Wed Dec 22, 2004 11:32 am    Post subject: Reply with quote

rohan28, when changing to /dev/hdd it unmounts cleanly. Thanks ;)
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Thu Dec 23, 2004 6:54 am    Post subject: Reply with quote

OK, the CVS version of Ivman now uses the configuration files in $HOME/.ivman if started by a non-root user. If the directory doesn't exist, then Ivman creates it and puts default config files into it.

This means that you can run Ivman as root to handle the mounting/unmounting of volumes for all users, and also run Ivman as a normal user (e.g. by putting a link to it in $HOME/.kde/Autostart or similar) to handle autoplay-type commands. I'm using it on my system now, and everything seems to be working nicely :-)

Of course I don't expect you all to get the CVS version; there's a couple of other issues I want to take care of, and then another release will be made. In retrospect, the last release really should have been an 'alpha' or 'beta' rather than 'release candidate' :-)
Back to top
View user's profile Send private message
kgraehl
n00b
n00b


Joined: 13 Sep 2003
Posts: 54

PostPosted: Sat Dec 25, 2004 5:18 pm    Post subject: Reply with quote

I finally got my eject working. I put this line into my /etc/conf.d/local.start
Code:

echo 0 > /proc/sys/dev/cdrom/lock


No idea why that was necessary, but now each type of cd (dvd vid/data, cd audio/data) ejects when I press the button on the computer.

I tried coming up with rules to enable automatic dvd playing, but they didn't seem to work. In particular, using the same dvd video, it was sometimes mounted and it was sometimes not mounted (according to lshal). Has anyone got this working?

It took a while to setup, but ivman is great! Here's my wishlist:

    be able to have actions on ethernet cable plug in/unplugged

    automatic samba mounting (will probably never happen...)
Back to top
View user's profile Send private message
Syntaxis
Guru
Guru


Joined: 28 Apr 2002
Posts: 511
Location: London, UK

PostPosted: Sun Dec 26, 2004 2:00 pm    Post subject: Reply with quote

kgraehl wrote:
be able to have actions on ethernet cable plug in/unplugged

You can emerge ifplugd to obtain this functionality.
_________________
The Debian User Forums - help them grow!
Back to top
View user's profile Send private message
oiper
Guru
Guru


Joined: 01 May 2003
Posts: 316
Location: Alabama, US

PostPosted: Mon Dec 27, 2004 6:02 pm    Post subject: matchnames Reply with quote

Hey, I want to set a rule to mount this (which usually shows up as /dev/sda1, but can show up as /dev/sdb1, etc.):

Code:
udi = '/org/freedesktop/Hal/devices/usb_device_54c_32_131_-1_noserial'
  info.udi = '/org/freedesktop/Hal/devices/usb_device_54c_32_131_-1_noserial'  (
string)
  linux.kernel_devname = 'usb-0000:00:07.2-1.1'  (string)
  usb_device.version_bcd = 272  (0x110)  (int)
  usb_device.speed_bcd = 4608  (0x1200)  (int)
  usb_device.num_ports = 0  (0x0)  (int)
  usb_device.linux.parent_number = 4  (0x4)  (int)
  usb_device.linux.device_number = 4  (0x4)  (int)
  usb_device.level_number = 2  (0x2)  (int)
  usb_device.port_number = 1  (0x1)  (int)
  usb_device.bus_number = 1  (0x1)  (int)
  info.product = 'MemoryStick MSC-U01 Reader'  (string)
  usb_device.product = 'MemoryStick MSC-U01 Reader'  (string)
  info.vendor = 'Sony Corp.'  (string)
  usb_device.vendor = 'Sony Corp.'  (string)
  usb_device.vendor_id = 1356  (0x54c)  (int)
  usb_device.product_id = 50  (0x32)  (int)
  usb_device.can_wake_up = false  (bool)
  usb_device.is_self_powered = true  (bool)
  usb_device.device_revision_bcd = 305  (0x131)  (int)
  usb_device.num_interfaces = 1  (0x1)  (int)
  usb_device.num_configurations = 1  (0x1)  (int)
  usb_device.max_power = 100  (0x64)  (int)
  usb_device.device_subclass = 0  (0x0)  (int)
  usb_device.device_protocol = 0  (0x0)  (int)
  usb_device.device_class = 0  (0x0)  (int)
  usb_device.configuration_value = 1  (0x1)  (int)
  info.parent = '/org/freedesktop/Hal/devices/usb_device_4cc_1122_110_-1_noseria
l'  (string)
  usb_device.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:07.2/usb1/1-1/1
-1.1'  (string)
  linux.sysfs_path_device = '/sys/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.1
'  (string)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.1'  (str
ing)
  info.bus = 'usb_device'  (string)


But I'm not sure how I should set the matchname. I've tried this:

Code:

    <ivm:Match name="hal.info.vendor" value="MemoryStick MSC-U01 Reader">
        <ivm:Option name="mount" value="true" />
    </ivm:Match>


But that doesn't yeild any results.

I also have a udev rule that symlinks /dev/sd?1 to /dev/memstick. I've read here that symlinks are an ugly way to use ivman, so, I need to use a matchname that works regardless of what my device gets "set" to. ie. /dev/sda, /dev/sdb, etc.

Any ideas?
_________________
www.bearscanfly.org - Because hiking is cool
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Tue Dec 28, 2004 3:35 am    Post subject: Reply with quote

Hi oiper, it looks to me like you've made a mistake in your rule there. 'hal.info.product' is the one which matches the value you gave, not 'hal.info.vendor'. Alternatively, you can change the udev rule to make /dev/memstick the actual device and /dev/sd* the symlinks and use 'hal.block.device' or just make an fstab entry.

Hi kgraehl:
Quote:
be able to have actions on ethernet cable plug in/unplugged

I agree, this is a very good idea :-) I'd like to implement more complex hardware management in a later version, and network interfaces would be a good thing to monitor. Syntaxis already mentioned that there's a program called 'ifplugd' which can do this, but it does it by polling the device at regular intervals, which we all know is the wrong thing to do (and wouldn't it be nice to have it all handled by one program anyway?)
Quote:
automatic samba mounting (will probably never happen...)

You're right, it probably will never happen (I sure as heck won't be coding for it). Ivman focuses on mounting something when media is inserted or attached, and net shares are never really inserted or attached. And there's already a decent solution to the problem of automatically (on access) mounting network shares - it's called autofs ('man 5 autofs'). That being said, if Ivman ever supports ethernet (un)plugging as suggested above, you will be able to configure it to, say, run "mount /mnt/smbshare" when connected and "umount /mnt/smbshare" when disconnected...

In other news... after having procured a new development platform with a DVD drive (don't you just love Christmas???), I'm about 70% sure I know what the problem is with DVD detection (I think it's a simple race condition). Once I fix this, I think it'll be time for the next release :-)
Back to top
View user's profile Send private message
rohan28
Tux's lil' helper
Tux's lil' helper


Joined: 12 Dec 2004
Posts: 84
Location: Australia

PostPosted: Tue Dec 28, 2004 10:54 am    Post subject: Reply with quote

Ivman 0.4_rc2 is now available from sourceforge. You can also emerge it by simply renaming / copying your ivman-0.4_rc1.ebuild to ivman-0.4_rc2.ebuild. I haven't asked Genstef to bump this in Portage yet (but feel free to do so if you are reading this :-))

New feature (yes, I know it's a 'release candidate' and shouldn't really have new features):
- runs nicely as non-root, using config files in ~/.ivman for autoplay functionality, automatically creates defaults if none yet exist

Bug fixes:
- video DVD detection should work reliably now
- substituting mount point for %m in 'exec' commands should work reliably now

If no-one has any problems with this version, it can probably be bumped to being a final rather than RC.

* * *

This is a little off-topic, but... my girlfriend comes from, and is currently in, Indonesia, one of the countries hit hard by the devastating Boxing Day tsunamis. I would really appreciate it, if you find Ivman useful, for you to donate something to one of the aid organisations helping the residents of these countries put their lives back together. Even just a couple of dollars would help...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3 ... 15, 16, 17 ... 27, 28, 29  Next
Page 16 of 29

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum