hald reading block devices

Alan Cox alan at redhat.com
Mon Aug 23 13:12:13 UTC 2004


On Mon, Aug 23, 2004 at 02:52:39PM +0200, David Zeuthen wrote:
> > 17 CD-ROM slots attached to one PC. As they are multichangers it'll take you
> > about 2 minutes to poll them all as well as ruining anything they were doing.
> > Any multichanger shouldn't be polled this way.
> 
> You can just blacklist polling on these using device information files
> (property name is storage.media_check_enabled). I don't have a
> multichanger and I don't think this is common hardware either so I
> haven't been able to blacklist them.

SCSI multichangers show up as multiple CD drives, as do ide-ones under
ide-scsi. Most of them are Nakamichi so you'd only need to know a few
"identify" strings

> HAL needs to run as root to invoke callouts. See this diagram
>  http://freedesktop.org/~david/hal-spec/hal-spec.html#ov_hal_linux26

Needs some rights. Root is kind of going away in SELinux.

> and surrounding text for more information, background etc. Presumably we
> can move to callouts (such as fstab-sync) to a separate helper process
> and by then drop a lot of privileges etc. Until that happens we need to
> run as root because the callouts may need privileges.

Yep. So all your callouts touch complex shared files with locking rules
and possible race attacks (or without sane locking rules sometimes).  Hard
to avoid though

> > > > Also one of my machines is logging the following repeatedly:
> > > > Aug 23 20:31:14 community kernel: hdc: packet command error: error=0x50
> > > > Aug 23 20:31:14 community kernel: cdrom: open failed.
> > 
> > Hal is triggering errors trying to open drives with no media. Probably hal
> > should keep the CD-ROM open, flip doorlock back off and use ATA media
> > sense packets. Thats horrible stuff to do unfortunately.
> > 
> 
> Sure, care to send a patch to the hal mailing list or some pointers on
> how to implement this?

Take a look at how magicdev does things. Magicdev sucks but it does the basic
open device, unlock door and poll stuff although it doesn't use the newer
media stuff





More information about the fedora-devel-list mailing list