FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 11-26-2011, 07:27 PM
clemens fischer
 
Default alsa start ( Fwd: udev events and /usr not mounted)

Myra Nelson wrote:

> Currently I don't want to try to migrate /usr to /. / is only 4 GB and
> /usr is 8+ GB and everything works to well so I'll just do a fresh
> install later. Otherwise sudo /usr/bin/alsactl start works well.

You could also put a line into etc/rc.local :

/etc/rc.d/alsa start || echo "cannot '/etc/rc.d/alsa start': $?"


clemens
 
Old 11-26-2011, 07:35 PM
Tom Gundersen
 
Default alsa start ( Fwd: udev events and /usr not mounted)

On Sat, Nov 26, 2011 at 9:27 PM, clemens fischer
<ino-news@spotteswoode.dnsalias.org> wrote:
> Myra Nelson wrote:
>
>> Currently I don't want to try to migrate /usr to /. / is only 4 GB and
>> /usr is 8+ GB and everything works to well so I'll just do a fresh
>> install later. Otherwise sudo /usr/bin/alsactl start works well.
>
> You could also put a line into etc/rc.local :
>
> */etc/rc.d/alsa start || echo "cannot '/etc/rc.d/alsa start': $?"

Should be enough to add "alsa" to your DAEMONS array in rc.conf. /usr
is always mounted by the time the daemons are started.

Cheers,

Tom
 
Old 11-26-2011, 09:15 PM
Myra Nelson
 
Default alsa start ( Fwd: udev events and /usr not mounted)

On Sat, Nov 26, 2011 at 14:35, Tom Gundersen <teg@jklm.no> wrote:

> On Sat, Nov 26, 2011 at 9:27 PM, clemens fischer
> <ino-news@spotteswoode.dnsalias.org> wrote:
> > Myra Nelson wrote:
> >
> >> Currently I don't want to try to migrate /usr to /. / is only 4 GB and
> >> /usr is 8+ GB and everything works to well so I'll just do a fresh
> >> install later. Otherwise sudo /usr/bin/alsactl start works well.
> >
> > You could also put a line into etc/rc.local :
> >
> > /etc/rc.d/alsa start || echo "cannot '/etc/rc.d/alsa start': $?"
>
> Should be enough to add "alsa" to your DAEMONS array in rc.conf. /usr
> is always mounted by the time the daemons are started.
>
> Cheers,
>
> Tom
>

To all:

Alsa is in my daemons array and starts. The problem is the udev rule to
restore the volume levels fails as it is run before /usr is mounted. That's
why I was asking about udev rules and why [ /usr/bin/alsactl restore ]
works from the console after I've booted. After reading through the
initscripts, rc.d, and mkinitcpio code I think it may be possible to run:

[
run_hook sysinit_postmount

udevam control --reload-rules

run_hook single_end
]

in rc.local.

I have some research to do. My thought process was to automate the task,
laziness is the mother of invention, rather than remembering to run alsactl
restore after I boot.
Thanks for the replies. Maybe Dave could weigh in on this for some
clarification on the hooks for the rc files and if I'm on the right track.

Myra

--
Life's fun when your sick and psychotic!
 
Old 11-27-2011, 11:21 PM
Myra Nelson
 
Default alsa start ( Fwd: udev events and /usr not mounted)

On Sun, Nov 27, 2011 at 13:06, clemens fischer <
ino-news@spotteswoode.dnsalias.org> wrote:

> Myra Nelson wrote:
>
> > Alsa is in my daemons array and starts. The problem is the udev
> > rule to restore the volume levels fails as it is run before /usr
> > is mounted. That's why I was asking about udev rules and why [
> > /usr/bin/alsactl restore ] works from the console after I've
> > booted. After reading through the initscripts, rc.d, and mkinitcpio
> > code I think it may be possible to run:
> >
> > [
> > run_hook sysinit_postmount
> >
> > udevam control --reload-rules
> >
> > run_hook single_end
> > ]
> >
> > in rc.local.
>
> The hooks don't work like this, rc.local might run too late.
>
> You'd make a file eg. /etc/rc.d/functions.d/my-hooks.sh:
>
> my_sysinit_postmount_udevadm()
> {
> udevadm control --reload-rules ||
> echo "my_sysinit_postmount_udevadm: udevadm err $?"
> return 0
> }
> add_hook sysinit_postmount my_sysinit_postmount_udevadm
>
> Putting the file into etc/rc.d/functions.d/ will let the hooks system
> see and source it, and add_hook() will put your function into the array
> of functions to run at a specific point. The list of hooks is in
> etc/rc.d/functions and a custom hook function is a regular shell
> function. No special error handling or sandboxing is done on them, so
> you want to make sure they don't block or kill the shell. This is why
> I'd recommend to use the "|| ..." clause after some user command and to
> return a zero at the end, though ATM neither seems strictly necessary.
> It will make a hook funtion future proof, I presume.
>
>
> clemens
>
> Clemens:

Thanks for the reply. I figured out the hook didn't work that way but it
didn't keep me from booting. Removing the run_hook around the udevadm
command and leaving it in rc.local takes care of the problem. It's only
necessary to restore the volume state stored in the asound file in /etc and
the udevadm command takes care of it. However I will take your response and
study the hooks and how to use them and learn something from this
experience.

Myra

--
Life's fun when your sick and psychotic!
 

Thread Tools




All times are GMT. The time now is 07:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org