From owner-acpi-jp@jp.FreeBSD.org Sat Nov  9 17:59:55 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id gA98xtc43666;
	Sat, 9 Nov 2002 17:59:55 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mail-out2.apple.com (mail-out2.apple.com [17.254.0.51])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id gA98xs343641
	for <acpi-jp@jp.freebsd.org>; Sat, 9 Nov 2002 17:59:54 +0900 (JST)
	(envelope-from msmith@freebsd.org)
Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225])
	by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id gA98xpI23984
	for <acpi-jp@jp.freebsd.org>; Sat, 9 Nov 2002 00:59:52 -0800 (PST)
Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com
 (Content Technologies SMTPRS 4.2.5) with ESMTP id <T5e72b7d329118064e1594@mailgate1.apple.com>;
 Sat, 9 Nov 2002 00:59:35 -0800
Received: from freebsd.org (vpn-scv-x3-16.apple.com [17.219.194.16])
	by scv1.apple.com (8.11.3/8.11.3) with ESMTP id gA98xpc13584;
	Sat, 9 Nov 2002 00:59:51 -0800 (PST)
Content-Type: text/plain; charset=US-ASCII; format=flowed
Mime-Version: 1.0 (Apple Message framework v546)
Cc: current@freebsd.org
To: acpi-jp@jp.FreeBSD.org
From: Michael Smith <msmith@freebsd.org>
In-Reply-To: <1036827741.998.17.camel@samwise.xu.nordahl.net>
Message-Id: <9AABB1DC-F3C1-11D6-BB77-0050E4660701@freebsd.org>
Content-Transfer-Encoding: 7bit
X-Mailer: Apple Mail (2.546)
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Sat, 9 Nov 2002 00:59:50 -0800
X-Sequence: acpi-jp 1927
Subject: [acpi-jp 1927] Re: acpid implementation?
Errors-To: owner-acpi-jp@jp.FreeBSD.org
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: msmith@freebsd.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+021107


On Friday, November 8, 2002, at 11:42 PM, Frode Nordahl wrote:

>> Why do you need an acpid?
> misc stuff

That's not going to get you anywhere.

> instruct dhclient to get a new lease on resume (maybe free it on 
> sleep),
> try to configure wlan if no link detected on ethernet etc.

This doesn't warrant an 'acpid'.

> I put my computer to sleep instead of turning it of most of the time,
> and having to run "killall dhclient; dhclient dc0" every time I resume
> it after coming home / go to work is a bit annoying :)

So fix the real problem.

> I'm sure people have this and other things they want to configure their
> computer to do on sleep / resume.

I'm sure that you think that FreeBSD needs an acpid because Linux
has an acpid.

For your specific, narrow example, how about you fix the
sleep/wakeup sequencing in FreeBSD's ethernet drivers so that
they correctly queue link-down/link-up events, and then fix
dhclient so that when it sees a link-down to link-up transition,
it reacquires its lease.

Then you will have solved a real problem in an almost correct
fashion, and people like me won't think you're a mindless drone.

Most of the other things that an 'acpid' would do are specific
examples of more general classes of events, for which software
should be able to request notification and handle it accordingly.

For an ugly but effective middle path, look at the Darwin
configd/Kicker mechanism.  I don't recommend porting it because
the problems deserve better solutions, but perhaps it'll get
you thinking in a more general fashion.

  = Mike

