tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: powerd on boot

Jason Thorpe wrote:

On May 15, 2008, at 10:45 AM, Christoph Egger wrote:

...catching up on old mail...

The problem, sysmon_power_daemon is NULL when powerd is not running.
So when I inject the event into sysmon (which is _before_ powerd) runs,
the event is lost.

The idea there is for sysmon to be able to do something "reasonable" when a power switch event occurs when the daemon is not running, like call cpu_reboot() or whatever.

Any ideas on how to fix that?

You could special-case the different kinds of switches and choose to enqueue events for certain kinds of keys (or, rather, for keys !stuff-that-needs-to-be-acted-on-immediately).

I have this diff:

Jared doesn't like it. He provided this idea:

acpidalb(4) exposes a sysctl say kern.autolaunch.

Runtime events presses goes to powerd (= wakeup from resume),
boot time events are reported via sysctl (= system-wake).

At boot time a /etc/rc.d/applaunch will check for kern.autolaunch.
powerd will run /etc/powerd/actions/wakeup from resume.

Both will run /usr/sbin/dapplaunch <id> <reason>
and the mapping of event to action is configured in /etc/applaunch.conf


Home | Main Index | Thread Index | Old Index