devfs
[Top] [All Lists]

Re: devfs and module 'post-install' commands

To: Jurgen Botz <jurgen@xxxxxxxx>
Subject: Re: devfs and module 'post-install' commands
From: Richard Gooch <rgooch@xxxxxxxxxxxxxxx>
Date: Fri, 22 Jun 2001 10:23:25 -0600
Cc: devfs@xxxxxxxxxxx
In-reply-to: <200106221513.f5MFDjV03760@xxxxxxxxxxxxx>
References: <200106221513.f5MFDjV03760@xxxxxxxxxxxxx>
Sender: owner-devfs@xxxxxxxxxxx
Jurgen Botz writes:
> I just discovered an interesting little problem... on my RH 7.1 system
> which I have configured to use devfs I've always had the problem that
> I'd lose my mixer settings after the sound module got auto-unloaded
> and later auto-loaded when something tried to play a sound.  Now 
> RedHat has the following in modules.conf that's supposed to prevent
> this:
> 
>   post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L
>   pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S
> 
> I finally spent some time investigating this and found that the
> that aumix-minimal wants to open /dev/mixer, but /dev/mixer is
> a symlink to /dev/sound/mixer which devfsd creates.  Well, the
> problem is that when the post-install command runs devfsd hasn't
> had a chance to do this yet!  It isn't just timing... inserting
> a delay in the post-install command above doesn't help.
> Apparently the event doesn't get sent to devfsd until after
> all the post-install commands have run?  Is that right, Richard?

Correct. Since devfsd is single-threaded, it has to wait for all
actions for an event to finish processing before it can grab the next
event from the queue. Threading devfsd is something I really don't
want to do. It would complicate the user-space and kernel-space code
considerably, and lead to subtle bugs (more subtle than the
interaction you've noticed).

> Anyway, the simple solution is to explicitly tell aumix to use the
> real devfs device name i.e.
> 
>   post-install sound-slot-0 /bin/aumix-minimal -d /dev/sound/mixer -f 
> /etc/.aumixrc -L

I'd say this is the right solution.

> This solution should work for most other cases where a post-install
> command is needed since any program to do something with a device
> should have an option for specifying the name.  I thought I should
> mention it on the list in case someone else gets bitten by this...

Thanks.

                                Regards,

                                        Richard....
Permanent: rgooch@xxxxxxxxxxxxx
Current:   rgooch@xxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>