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-27-2011, 06:06 PM
clemens fischer
Default alsa start ( Fwd: udev events and /usr not mounted)

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:

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.


Thread Tools

All times are GMT. The time now is 03:00 PM.

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