Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 2010 07:07:33 +0200
From:      David DEMELIER <demelier.david@gmail.com>
To:        dave jones <s.dave.jones@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: ACPI questions about press power button
Message-ID:  <AANLkTi=fNmv_m7iLLr8ij1fAOC_7RKVVxz-06iKkjKWS@mail.gmail.com>
In-Reply-To: <AANLkTi=L9qLO%2BqX_ik63Q1mrTEMgzLLRDFKndc%2Bv-u=a@mail.gmail.com>
References:  <AANLkTi=L9qLO%2BqX_ik63Q1mrTEMgzLLRDFKndc%2Bv-u=a@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/9/5 dave jones <s.dave.jones@gmail.com>:
> Hello,
>
> I'm running FreeBSD 8 on my desktop. I want to write a file or do somethi=
ng
> when I or someone presses power button. In devd.conf, I added the
> following lines
> for testing:
>
> =C2=A0notify 10 {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match "system" =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0"ACPI";
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match "subsystem" =C2=A0 =C2=A0 =
=C2=A0"Button";
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0matcho "notify" =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0"0x00"
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0action "echo hello world";
> =C2=A0 =C2=A0};
>
> But it doesn't work. Would anyone tell me how to do? Thanks.
>
> Regards,
> Dave.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o=
rg"
>

I think, you must first disable this setting because S5 is the default
behavior when pressing the power button, it calls /etc/rc.shutdown.

hw.acpi.power_button_state: S5

Disable it with sysctl hw.acpi.power_button_state=3DNONE and add this
line to /etc/sysctl.conf. And then maybe the power button will be
released for an other purpose?

Kind regards.

--=20
Demelier David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=fNmv_m7iLLr8ij1fAOC_7RKVVxz-06iKkjKWS>