[PATCH] fix for acpi-addon if use/compile with acpid

Ryan Lortie desrt at desrt.ca
Wed Oct 19 05:16:10 PDT 2005

On Wed, 2005-19-10 at 10:17 +0100, Richard Hughes wrote: 
> On Wed, 2005-10-19 at 00:15 +0200, Danny Kukawka wrote:
> > Hi,
> > 
> > this path fix a problem if you compiled the acpi addon (hald-addon-acpi) 
> > for/with acpid support. This patch should prevent that the addon exit, if the 
> > acpid is not running on startup of HAL. Without the patch you need to restart 
> > hald if the acpid is started later.

This is true, but this was the intended behaviour of the addon.  The
idea is that if acpid isn't running on start up then we assume that the
user doesn't have acpid installed or doesn't want to run it.
Distributions do a good job of making sure acpid is brought up before
HAL so afaik this is never a problem.  This approach prevents the addon
from becoming a useless process that does absolutely nothing but try to
connect every 5 seconds to a non-existent event source.

> I thought Ryan fixed this with the "reconnecting" stuff... I've cc'd him
> as i don't think he's on hal-devel list.
Thanks for the CC :) 

> > With this patch I also changed the position of the defines for acpid and 
> > kernel proc event source to remove unneeded function call.
Please don't do this.  This was also intentional.  This approach is the
generally recommended method (books, etc) since, even though it has the
potential for call overhead the overhead is -very- small (possibly zero
if the compiler inlines) and there are other advantages (better
abstraction, no compiler warnings about unused functions, etc).

>  Also added a debug 
> > message, if the addon lost the connection to the acpi proc interface.
You should consider rephrasing this warning.  It's not just thrown when
you've failed to connect, but also when you've merely been

> I get this sometimes, and then subsequently loose all acpid events (as
> I'm not running acpid). Is it worth trying to reconnect to the proc
> event source or is this a kernel bug somewhere?
I was operating under the assumption that either the kernel support
existed or did not exist.  I don't know this as a fact -- it just sort
of made sense that that would be the case (ie: it never disconnects you,
and if it's not there on startup then it won't ever be there).  Does
anyone know this for sure?



More information about the hal mailing list