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 ... 20, 21, 22 ... 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: Mon Feb 14, 2005 12:21 am    Post subject: Reply with quote

nightfrost: Actually, this problem (and the solution) already came up here 5 days ago :-) You can also fix it by building the UTF8 NLS into your kernel, which is probably a good idea anyway, as then you'll be able to correctly see CJK (Chinese/Japanese/Korean) and Russian and etc filenames on a FAT formatted filesystem. (incidentally... thank you, Mr. nightfrost, for providing support for other users here :))
Back to top
View user's profile Send private message
nightfrost
Apprentice
Apprentice


Joined: 07 Dec 2004
Posts: 293
Location: Sweden

PostPosted: Mon Feb 14, 2005 1:00 am    Post subject: Reply with quote

Quote:
incidentally... thank you, Mr. nightfrost, for providing support for other users here

It's just quite recently I notice myself being able to help out other users (it's a crazy feeling when you notice how you're actually leaving the "noobhood" behind and moving into... something else), so I do that as often as I can :). And since ivman is such neat little thing, I'd like to help out here... Next time I'll try to pay more attention to old posts, though. Anyway, thanks for the tip :)
Back to top
View user's profile Send private message
-spirit-
n00b
n00b


Joined: 16 Dec 2004
Posts: 9
Location: Tournai / Belgique

PostPosted: Mon Feb 14, 2005 7:31 am    Post subject: Reply with quote

finally, last ivman works for me :) (version 0.5) . no more crash or bug. it's really fantastic.

Thanks you Ikke :D
Back to top
View user's profile Send private message
jwc
n00b
n00b


Joined: 31 Jan 2004
Posts: 57
Location: Germany

PostPosted: Mon Feb 14, 2005 5:56 pm    Post subject: Bug or feature? Reply with quote

Hi Rohan, thanks for your great work!
Today I tried out some stuff with the user config files and stumbled over to segfaults.
One happens if you put -- in a xml-comment, the other one if you have & somewhere outside of a comment in the config file.
Just to let you know, bye,

Joost
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 Feb 14, 2005 11:49 pm    Post subject: Reply with quote

jwc: Yes, I know, at the moment if you have any errors in your XML, Ivman will simply segfault. This should be changed to output a helpful error message and attempt to continue parsing the XML. For the configuration files to be 'well-formed', & must be escaped as & , -- must not appear within comments, etc etc. Ivman will probably always fail on badly formed XML (it's quite difficult to continue parsing it sensibly, which is why web browsers are so hard to do well :-)) but it could certainly stand to output some helpful error message instead of just segfaulting.
Back to top
View user's profile Send private message
DrWoland
l33t
l33t


Joined: 13 Nov 2004
Posts: 603

PostPosted: Tue Feb 15, 2005 5:52 am    Post subject: Reply with quote

O crap, had my first problem with this setup, but I doubt it had to do with this specifically. My system has too many shaky variables to blame it on the trio. Nothing was mounting right (folders were being created, but not mounted) so I went to restart ivman and my system straight up HARDLOCKED on "Stopping hardware abstraction layer daemon..." or whatever it says when it's stopping hald. Works fine after a reboot tho, and thanks to RR4 (which may have caused the crash as well) nothing got lost or corrupted.
_________________
I'm not a Guru, I just ask a lot of questions.
Back to top
View user's profile Send private message
nightfrost
Apprentice
Apprentice


Joined: 07 Dec 2004
Posts: 293
Location: Sweden

PostPosted: Tue Feb 15, 2005 8:36 am    Post subject: Reply with quote

DrWoland wrote:
O crap, had my first problem with this setup, but I doubt it had to do with this specifically. My system has too many shaky variables to blame it on the trio. Nothing was mounting right (folders were being created, but not mounted) so I went to restart ivman and my system straight up HARDLOCKED on "Stopping hardware abstraction layer daemon..." or whatever it says when it's stopping hald. Works fine after a reboot tho, and thanks to RR4 (which may have caused the crash as well) nothing got lost or corrupted.


Yeah, I've had the exact same symptom when stopping hald (although this has nothing to do with ivamn, cause ivman wasn't running at all). And the thing is, I think my system is pretty stable. At least everything is compiled with a plain -O2 (and some other easy-going flags). It's really amazing how it locks up - I've never seen anything like it. It reminds me of a peacful death and the only thing to do is the power button. Should one file this as a bug report?
Back to top
View user's profile Send private message
phranzee
Guru
Guru


Joined: 22 Nov 2003
Posts: 397
Location: katowice/pl

PostPosted: Tue Feb 15, 2005 2:44 pm    Post subject: Reply with quote

ok, here goes my error (mentioned on previous page):
Code:

/mnt/dvd: file *
xxxxx.avi:   RIFF (little-endian) data, AVI, 512 x 384, 23.98 fps, video: DivX 3 Low-Motion, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
yyyyy.avi:  ERROR: cannot read `yyyyy.avi' (Input/output error)
zzzzz.avi: ERROR: cannot read `zzzzz.avi' (Input/output error)


dmesg:
Code:

(...)
Buffer I/O error on device hdc, logical block 115112
attempt to access beyond end of device
hdc: rw=0, want=930884, limit=10856
Buffer I/O error on device hdc, logical block 232720
attempt to access beyond end of device
hdc: rw=0, want=930888, limit=10856
Buffer I/O error on device hdc, logical block 232721


Code:

/mnt/dvd: cat zzzzz.avi
cat: zzzzz.avi: Input/output error

_________________
signature fault
post dumped ;]
Back to top
View user's profile Send private message
ikke
Apprentice
Apprentice


Joined: 14 Jan 2005
Posts: 225
Location: Belgium

PostPosted: Tue Feb 15, 2005 6:48 pm    Post subject: Reply with quote

-spirit- wrote:
finally, last ivman works for me :) (version 0.5) . no more crash or bug. it's really fantastic.

Thanks you Ikke :D
Guess you should thank Rohan more than me lately ;)
_________________
Working day and night to enhance your Linux Desktop experience :)
Blog
Back to top
View user's profile Send private message
hoeeg
n00b
n00b


Joined: 04 Jul 2002
Posts: 26
Location: Denmark

PostPosted: Tue Feb 15, 2005 7:11 pm    Post subject: Reply with quote

rohan28 wrote:
Ivman will probably always fail on badly formed XML (it's quite difficult to continue parsing it sensibly, which is why web browsers are so hard to do well :-)) but it could certainly stand to output some helpful error message instead of just segfaulting.


According to the specs an XML parser is supposed to fail on badly formed XML. It's not a bug, it's a feature. :)
Back to top
View user's profile Send private message
Tyris
n00b
n00b


Joined: 04 May 2003
Posts: 44
Location: Cincinnati, OH

PostPosted: Wed Feb 16, 2005 12:20 am    Post subject: Reply with quote

hoeeg wrote:
According to the specs an XML parser is supposed to fail on badly formed XML.

I know you're just making light of ivman's segfaulting, but even if the parser fails, it doesn't mean the program using the it (i.e. ivman) has to fail as well. Surely an error message is possible here, but again it's certainly not a big issue.
Back to top
View user's profile Send private message
DrWoland
l33t
l33t


Joined: 13 Nov 2004
Posts: 603

PostPosted: Wed Feb 16, 2005 2:32 am    Post subject: Reply with quote

nightfrost wrote:
DrWoland wrote:
O crap, had my first problem with this setup, but I doubt it had to do with this specifically. My system has too many shaky variables to blame it on the trio. Nothing was mounting right (folders were being created, but not mounted) so I went to restart ivman and my system straight up HARDLOCKED on "Stopping hardware abstraction layer daemon..." or whatever it says when it's stopping hald. Works fine after a reboot tho, and thanks to RR4 (which may have caused the crash as well) nothing got lost or corrupted.


Yeah, I've had the exact same symptom when stopping hald (although this has nothing to do with ivamn, cause ivman wasn't running at all). And the thing is, I think my system is pretty stable. At least everything is compiled with a plain -O2 (and some other easy-going flags). It's really amazing how it locks up - I've never seen anything like it. It reminds me of a peacful death and the only thing to do is the power button. Should one file this as a bug report?


If your system really is compiled with stable CFLAGS and using only unmasked packages in the toolchain, then yeah, you should probably file one. They'll ignore my setup, and I'd rather not falsify my specs for a bugreport. Just mention that other users with different configs have had the same problem.

And yeah, it's hardlock. When numlock stops working, it's time to reach for that power key. Thank god for Reiser and the lack of corruption it brings.
_________________
I'm not a Guru, I just ask a lot of questions.
Back to top
View user's profile Send private message
ikke
Apprentice
Apprentice


Joined: 14 Jan 2005
Posts: 225
Location: Belgium

PostPosted: Wed Feb 16, 2005 2:08 pm    Post subject: Reply with quote

DrWoland wrote:
nightfrost wrote:
DrWoland wrote:
O crap, had my first problem with this setup, but I doubt it had to do with this specifically. My system has too many shaky variables to blame it on the trio. Nothing was mounting right (folders were being created, but not mounted) so I went to restart ivman and my system straight up HARDLOCKED on "Stopping hardware abstraction layer daemon..." or whatever it says when it's stopping hald. Works fine after a reboot tho, and thanks to RR4 (which may have caused the crash as well) nothing got lost or corrupted.


Yeah, I've had the exact same symptom when stopping hald (although this has nothing to do with ivamn, cause ivman wasn't running at all). And the thing is, I think my system is pretty stable. At least everything is compiled with a plain -O2 (and some other easy-going flags). It's really amazing how it locks up - I've never seen anything like it. It reminds me of a peacful death and the only thing to do is the power button. Should one file this as a bug report?


If your system really is compiled with stable CFLAGS and using only unmasked packages in the toolchain, then yeah, you should probably file one. They'll ignore my setup, and I'd rather not falsify my specs for a bugreport. Just mention that other users with different configs have had the same problem.

And yeah, it's hardlock. When numlock stops working, it's time to reach for that power key. Thank god for Reiser and the lack of corruption it brings.
Use Magic SysRQ? -> sync, umount, reboot
_________________
Working day and night to enhance your Linux Desktop experience :)
Blog
Back to top
View user's profile Send private message
g4c9z
Apprentice
Apprentice


Joined: 03 Jun 2004
Posts: 178

PostPosted: Thu Feb 17, 2005 10:43 pm    Post subject: Reply with quote

What's the status of automatic DVD video playing when it's inserted? Is it supposed to work? Because when I insert it nothing happens. I uncommented the line in the config file to make it work, so that it now reads:
Code:
    <ivm:Option name="execdvd" value="umount $hal.block.device$ &amp;&amp; /usr/bin/mplayer dvd://1 -really-quiet -fs" />

Furthermore, when I start mplayer manually, it crashes (I can post the output if it would be useful). But if I stop the ivman service then run the same mplayer command, it plays the movie.

Also, what's this about mounting/unmounting DVD videos? Obviously they don't need to be mounted to play them, and I'm pretty sure it's impossible to mount one...

My drive is an AOpen IDE DVD-ROM.
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: Fri Feb 18, 2005 1:43 am    Post subject: Reply with quote

g4c9z: I assure you that it is definitely possible to mount video DVDs :-) In fact, after getting a laptop with a DVD drive a month and a half ago, it took me a while to figure out that you weren't supposed to mount when watching DVDs (I know it sounds silly, but hey, this little fact seems to be missing from the documentation of all the DVD playing software out there :-)) I don't see quite why it's "obvious" that you don't have to mount them, as you state...

Video DVD playing is indeed supposed to work with Ivman now, and it does for me. I use Xine instead of MPlayer, but that shouldn't really make a difference here... I have a hunch that the problem you're having is related/is the same problem as that which other people have reported, about I/O errors when reading files towards the end of the disc. If you insert a video DVD as the very first disc after Ivman is started, does it work? Is there any output in dmesg about attempting to read beyond the end of a device when you insert the DVD? If there is indeed output like this in dmesg, please tell me which version of HAL you're using, and which kernel. I really want to track this bug down... also, it couldn't hurt to post the MPlayer output you're seeing when it crashes :-)
Back to top
View user's profile Send private message
g4c9z
Apprentice
Apprentice


Joined: 03 Jun 2004
Posts: 178

PostPosted: Fri Feb 18, 2005 3:04 am    Post subject: Reply with quote

Quote:
I don't see quite why it's "obvious" that you don't have to mount them, as you state...


Well, because mounting something means taking files on one filesystem and overlaying them onto a directory on another filesystem, so that multiple physical media can be accessed transparently as if they were one piece of media. A DVD video does not contain a filesystem.

Quote:
If you insert a video DVD as the very first disc after Ivman is started, does it work?


Yes! In fact, it also works a second time if I eject the DVD and re-insert it. I can't reproduce it at all anymore, not even if I insert a CD-ROM in between, which ivman mounts. Does it only happen if the first thing inserted is not a DVD?

I didn't see any messages in the output of dmesg that seemed to belong to ivman. The following is possibly from it:

Code:
scsi: unknown opcode 0x1e


but it only occurred once and the DVD playing failed many times.

So this is a bug, then? How can I help provide info so it can be fixed?

Another problem is that it locks the DVD in the drive until I use the eject command. With the other media types there's an "unlock" option. Until I can prevent that it's not really practical to use ivman for DVDs. Even when using eject, it gives the output:

Code:
eject: unable to eject, last error: Invalid argument


but ejects it anyway. In dmesg the following message appears:

Code:
program eject is using a deprecated SCSI ioctl, please convert it to SG_IO


Quote:
it couldn't hurt to post the MPlayer output you're seeing when it crashes


OK. I'll just post mostly the important stuff (in other words, the errors :) )
Code:
Playing dvd://1.
Reading disc structure, please wait...
There are 3 titles on this DVD.
There are 28 chapters in this DVD title.
There are 1 angles in this DVD title.
DVD successfully opened.
libdvdread: Can't seek to block 362177
Cache fill:  0.00% (0 bytes)    XMMS: found plugin: libmp4.so (MP4 & MPEG2/4-AAC audio player - 1.2.x)
XMMS: found plugin: libwav.so (Wave Player 1.2.10)
XMMS: found plugin: libcdaudio.so (CD Audio Player 1.2.10)
XMMS: found plugin: libtonegen.so (Tone Generator 1.2.10)


MPlayer interrupted by signal 11 in module: demux_open
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
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: Fri Feb 18, 2005 3:35 am    Post subject: Reply with quote

g4c9z: Video DVDs do contain filesystems; if you've got UDF support in your kernel, you can mount and browse them like a CD. Although there's not much interesting on there :-)

What you are seeing, is a particularly nasty bug which I have known about for a few days now... but I'm not sure what to do about it. What happens seems to be that the kernel gets confused; the kernel reads the size of the first DVD (probably CD as well) you insert when Ivman is running, but it doesn't update the size when you insert any new DVDs/CDs. Then, if you try to read a file on the current disc which resides on a block past the amount of blocks on the first disc, the kernel thinks you're trying to read off the end of the disc and won't let you. This can make the bug appear somewhat intermittent; if you insert a disc with a very large filesystem first (like a video DVD :-)) and then insert smaller things, like CDs, you may never experience this bug.

It's certainly a pretty weird one, and I haven't been able to figure out exactly where it comes from. Although the bug doesn't appear when Ivman isn't running, I know it's not Ivman's fault; it could be libhal's, but I tried older versions of HAL and could still reproduce it. I think it must be something new, since the error was only reported recently, but given the sporadic nature of the bug and the fact that Ivman simply might not have had enough users to experience the bug until recently, it's possible it's existed all along :-( I don't even know of any workarounds - I thought manually unmounting the disc before ejecting would fix it, but no dice. I'm going to try different kernels and see how that affects it.

This bug could be a real show stopper for Ivman. Got to fix it...!
Back to top
View user's profile Send private message
g4c9z
Apprentice
Apprentice


Joined: 03 Jun 2004
Posts: 178

PostPosted: Fri Feb 18, 2005 3:46 am    Post subject: Reply with quote

Quote:
g4c9z: Video DVDs do contain filesystems; if you've got UDF support in your kernel, you can mount and browse them like a CD. Although there's not much interesting on there Smile


OK, sorry, I didn't realize that.

You should try reporting the bug to bugs.kernel.org if switching kernel versions makes it go away. I'm using 2.6.10 - maybe so are all the people who had the problem.

Is there any hope that ivman will eventually be able to unlock the drive for DVD videos? What about a global unlock option for all types of CDs?
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: Fri Feb 18, 2005 4:03 am    Post subject: Reply with quote

g4c9z: Sorry, I forgot to address the unlocking. Ivman _does_ unlock the DVD drive when a disc is inserted... in fact, it tries to unlock all removable media... but the DVD playing app locks it again, and does not unlock it when it's done :-( The thing is, you typically need to have root privileges to unlock the drive, so it's probably not even possible for a DVD playing app not running as root to unlock it when done. (I'm not sure how they lock it in the first place though... perhaps the kernel automatically locks the drive when an app asks for raw access to the disc, but it has no way of knowing once the program has finished.)

My solution has been to put eject into /etc/sudoers and then just use "sudo eject" - I bound it to Win+Backspace so I can easily eject. You could also put "&& sudo eject" at the end of your DVD playing rule to automatically eject once you quit MPlayer. It could be possible for Ivman to simply poll the drive and make sure it's still unlocked every minute or so... it's kind of ugly, but it might actually be the least hacky solution for now. Since we ultimately want something that 'just works', I guess this is what we'll end up doing.
Back to top
View user's profile Send private message
g4c9z
Apprentice
Apprentice


Joined: 03 Jun 2004
Posts: 178

PostPosted: Fri Feb 18, 2005 6:02 pm    Post subject: Reply with quote

rohan28: Please don't do polling. In fact, that reminds me of a question I forgot to ask: does ivman (or the things it depends on) currently use polling or interrupts to detect when a CD is inserted? The reason I didn't use supermount is because I don't want it doing checks every few seconds. That's also a thing I didn't like about Windows. Only Macs do things properly in my experience, and apparently only because they have good hardware.

A good CD drive would send a signal to the operating system when the eject button is pressed on it. How can I check whether mine does that?

Working around CD drives that don't do that is tricky. I believe the way you said it's done is not good (automatically locked, only root can unlock it). Even allowing only the user who is active when the CD is inserted to later unlock it is not good (someone might walk away with a CD in the drive). The proper way to do it is to allow the user sitting in front of the computer (not logged in remotely) to always be allowed to unlock it. If they aren't allowed, they can just use a paper clip anyway. I'm not sure how to tell who that user is but I'm pretty sure it's possible. Ultimately, this also means you have to eject through software (using e.g. a key combination as you mentioned) rather than with the eject button.

So the best way to work around that bad design is to use sudo on eject or make it suid root. That opens the possibility of someone remotely logging in and having fun opening and closing my CD tray. But since I can't think of why they would have a motivation to do that, I'll wait until it starts happening before I become concerned, and just do it that way.

And by the way: it IS possible to make things "just work" without using ugly hacks! :)
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: Sat Feb 19, 2005 2:30 am    Post subject: Reply with quote

g4c9z: Ivman just waits for events from HAL; it does not currently do any polling. I don't know too much about the internals of HAL - I basically only know what I need to know for Ivman to work - but I am pretty sure that HAL keeps polling to an absolute minimum, and would only do it if there's no other way. That being said, maybe there is no other way for some things, at least not without modifying the kernel.

As for the good CD drives sending a message to the OS when eject is pressed... a few do this, but not very many at all. See Ikke's comments at http://lists.freedesktop.org/archives/hal/2004-September/001071.html, for example. In fact, support for this event might have even been removed from HAL since so few drives used it. Ivman has code to nicely handle the EjectPressed event, but this code is useless on 95% of drives, so we obviously need another solution. To see if your drive supports this, run "lshal --monitor", then hit eject. If it outputs something like device_condition, /your/device/udi, condition_name=EjectPressed, then your drive supports it.

This bad hardware design is probably the main reason why most attempted solutions to the automounting problem have been kernel-based; if you can mess with things in the kernel, you can easily work around things the kernel does, like locking the drive. For Ivman to do the same thing, some ridiculously annoying stuff might need to be done (e.g. let the root and user instances of Ivman talk to each other, and have the user instance of Ivman signal to the root instance when all programs the user wanted to run have completed, at which point the drive can be unlocked).

Your idea about allowing the 'active' user to be able to unlock is a nice one, but it has some problems. Firstly, I'm not so sure that it's possible to tell who the 'active' user is; Linux is a true multi-user system, and it's possible to have different users logged in at a bunch of different VCs, and even more than one X server running with different users. In any case, discovering who the 'active' user is, is probably something too complicated to be done in the kernel, and that's probably where it would have to be done.

I wonder if you (or someone else) could try something for me...? It's nice and simple, but I'm too busy to find the time at the moment. Do "echo 0 > /proc/sys/dev/cdrom/lock" (as root)... this should prevent the drive from ever locking in the first place when media is inserted. I know this works for mounting filesystems on CDs; can you please tell me if it also works for video DVDs? i.e., if you do this, and then insert a video DVD and play it, can you eject it after playing without taking any extra steps? If so, even though this isn't a "nice" solution either, it might be the best solution currently available.
Back to top
View user's profile Send private message
Pubare
Tux's lil' helper
Tux's lil' helper


Joined: 24 Nov 2003
Posts: 81
Location: Lafayette, LA

PostPosted: Sat Feb 19, 2005 8:55 am    Post subject: Reply with quote

I've run into a problem that I think is basic and me just over-looking something simple...

When I first set-up ivman, it didn't want to notice when CD's had been inserted. So, I uncommented the example mapping in ConfigMappings and changed my fstab entry from /dev/hdc to /dev/cdroms/cdrom0. Presto, it starts working... except for the problem mentioned earlier (CDs don't umount on eject, but they do eject properly). So, what am I missing? I tried commenting out the mapping ("blank" ConfigMap file), putting /dev/hdc (yes, this is my CD-ROM drive) back into fstab, removing the /dev/cdroms dir, commenting out the UDEV rules to create /dev/cdrom and /dev/cdrw symlinks, and rebooting. Still doesn't work... Why does it work with the symlinks but NOT when the call is to the actual device?!?

Using a Liteon 32125s as /dev/hdc, udev-045, hal-0.4.7, dbus-0.23-r3, and ivman-0.5_pre2. I do have devfs in the kernel, but it is not set to mount on boot (in the kernel or on the kernel command line). I also have rc.conf set to save a dev tarball on shutdown, but this shouldn't be affecting it.

Thoughts or suggestions?
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: Sat Feb 19, 2005 9:02 am    Post subject: Reply with quote

Pubare: When it doesn't work, what does Ivman try doing? Set it to give debugging output and look at the 'mount' command it runs when you insert a CD.
Back to top
View user's profile Send private message
Pubare
Tux's lil' helper
Tux's lil' helper


Joined: 24 Nov 2003
Posts: 81
Location: Lafayette, LA

PostPosted: Sat Feb 19, 2005 12:24 pm    Post subject: Reply with quote

Thanks for the response rohan, but I found the problem... user error. I had a malformed comment header in the ConfigActions file. Somehow, one of the "<" got turned into a "less than or equal to" (underlined <). Don't know _how_ it happend and it wasn't showing up as such in nano (of course), found it using kwrite. Surprised it didn't segfault on it. I was using the same file with and without symlinks, though, so that doesn't really make sense either... but as soon as I fixed it, it started working with /dev/hdc. Odd.


Edit:
Now for another question... I'm trying to integrate packet-writing support into the ivman automounts, but I've got something wrong (if this is possible, or maybe I'm going about it the wrong way.

<!-- test rule for packet write support -->
<ivm:Match name="hal.block.device" value="/dev/hdc">
<ivm:Match name="volume.disc.type" value="cd_rw">
<ivm:Match name="hal.volume.disc.is_blank" value="true">
<ivm:Match name="hal.volume.disc.is_rewritable" value="true">
<ivm:Option name="exec" value="kdialog --yesno 'Blank CD-RW inserted - would you like to format it UDF for packet writing?' &amp;&amp; /etc/init.d/cdrw start &amp;&amp; cdrwtool -d $hal.block.device$ -q &amp;&amp; mount /mnt/cdrw &amp;&amp; kdialog --msgbox 'Format complete, CD-RW mounted at /mnt/cdrw'" />
<ivm:Option name="execun" value="/etc/init.d/cdrw stop" />
</ivm:Match>
</ivm:Match>
</ivm:Match>
</ivm:Match>

<ivm:Match name="hal.block.device" value="/dev/hdc">
<ivm:Match name="volume.disc.type" value="cd_rw">
<ivm:Match name="hal.volume.fstype" value="udf">
<ivm:Match name="hal.volume.disc.is_rewritable" value="true">
<ivm:Option name="exec" value="/etc/init.d/cdrw start &amp;&amp; mount /mnt/cdrw" />
<ivm:Option name="execun" value="/etc/init.d/cdrw stop" />
</ivm:Match>
</ivm:Match>
</ivm:Match>
</ivm:Match>

I know that's more Matches than needed, I just prefer being explicit ;) Initially I didn't have the match for /dev/hdc (thought it'd be more flexible), but stuck it in to be safe. I'm sure you can see what I'm _trying_ to do with this, but it doesn't seem to work - just mounts the udf formatted disc at /mnt/cdrom without loading the pktcdvd driver. But, I tend to be a bonehead that can't script or code for nothin'... Seems like a good idea though.
Back to top
View user's profile Send private message
g4c9z
Apprentice
Apprentice


Joined: 03 Jun 2004
Posts: 178

PostPosted: Sat Feb 19, 2005 6:01 pm    Post subject: Reply with quote

rohan28:
Quote:
To see if your drive supports this, run "lshal --monitor", then hit eject. If it outputs something like device_condition, /your/device/udi, condition_name=EjectPressed, then your drive supports it.


Darn, it seems my drive doesn't support it.

Edit: since that post mentioned that support for eject has been removed from HAL, doesn't that mean my drive may well still support it? If they don't have code for it simply because few drives support it, I'd say that's a horrible decision.

Quote:
Your idea about allowing the 'active' user to be able to unlock is a nice one, but it has some problems. Firstly, I'm not so sure that it's possible to tell who the 'active' user is; Linux is a true multi-user system, and it's possible to have different users logged in at a bunch of different VCs, and even more than one X server running with different users. In any case, discovering who the 'active' user is, is probably something too complicated to be done in the kernel, and that's probably where it would have to be done.


Hmm, interesting. Linux should know what the active user is, even though it's multi-user. But actually, I guess it's possible to have 1 computer but 2 keyboards and 2 monitors (dumb terminals) with 2 people logged in at once.

Quote:
I wonder if you (or someone else) could try something for me...? It's nice and simple, but I'm too busy to find the time at the moment. Do "echo 0 > /proc/sys/dev/cdrom/lock" (as root)... this should prevent the drive from ever locking in the first place when media is inserted. I know this works for mounting filesystems on CDs; can you please tell me if it also works for video DVDs? i.e., if you do this, and then insert a video DVD and play it, can you eject it after playing without taking any extra steps? If so, even though this isn't a "nice" solution either, it might be the best solution currently available.

That worked.

I guess, then, the situation is this: good drives send a signal when the person presses the eject button. That's the only way you can tell that the person sitting in front of it wants to eject it. For bad drives, you have to allow them to be ejected anytime by pressing the button, and programs must do something graceful when it's in the middle of reading from it and that happens (mplayer just freezes the picture and lets you quit with q, which is pretty good). Trying to keep a bad drive locked while allowing it to be unlocked under certain conditions simply can't, it seems to me, work without restricting people from ejecting it who should be allowed to, whether polling is used or not.

So I'd suggest changing the default config file to have 2 choices, one to always keep a device unlocked and one to lock it, with one commented out and an explanation. I'd still say locking should be the default, though I'm sure most will disagree with me, because it's best to assume people have good hardware and only make those with bad hardware work around it.

By the way, even though I had the global unlocking option uncommented like this:
Code:
    <ivm:Match name="storage.removable" value="true">
        <ivm:Option name="unlock" value="true" />
    </ivm:Match>

my audio CD wouldn't eject either, but it did after I put a local unlocking option within that "Match" section. So it seems ivman still doesn't have a global unlock option, or it has a bug.
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 ... 20, 21, 22 ... 27, 28, 29  Next
Page 21 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