suspend/resume event

Nate Lawson nate at root.org
Tue Jan 31 13:01:44 PST 2006


Manfred Lotz wrote:
> Hmmh. I got compile errors then. However with hw.ata.atapi_dma set to 0
> I could boot the 7.0 system and test it.
> 
> First of all: Your code did work, i.e. the kern/power/resume event gets
> triggered and I could call a script.
> 
> However, what confuses me is that the power button triggers
> the /etc/rc.resume in some cases (2. and 3. below) without using your
> code. 
> 
> 1. hw.acpi.sleep_button_state=S3 and no Button event in /etc/devd.conf
> 
> When suspending (Fn-ESC) and resuming (Power button)
> neither /etc/rc.suspend nor /etc/rc.resume gets called.

The kern/power/resume devd event should be delivered, no matter what the 
mechanism used to suspend/resume.  It should even work for apm, if you 
were using that.

So I really wonder what your test configuration was here.  What's the 
new contents of your devd.conf (different from 7.x default)?  You have 
to add a kern/power/resume event in devd.conf to run /etc/rc.resume 
although I plan to commit that also eventually.

> 2. hw.acpi.sleep_button_state=S3 and Button event in /etc/devd.conf is
> activated
> 
> Here both /etc/rc.suspend and /etc/rc.resume gets
> called. /et/rc.suspend gets called via devd.conf action.

You can't count on running rc.suspend from devd.  The system could 
suspend BEFORE the process even runs, then you'd resume and rc.suspend 
would run and immediately after, rc.resume would run.

> 3.  hw.acpi.sleep_button_state=NONE and Button event in /etc/devd.conf
> is activated
> 
> 3. seems to be the best option.,

I see no need for you to run rc.suspend.  To restart moused, you just 
need rc.resume.

-- 
Nate


More information about the freebsd-acpi mailing list