From owner-freebsd-questions@FreeBSD.ORG Tue Sep 7 05:07:34 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9C2110656A3 for ; Tue, 7 Sep 2010 05:07:34 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 683DD8FC16 for ; Tue, 7 Sep 2010 05:07:33 +0000 (UTC) Received: by bwz20 with SMTP id 20so4638940bwz.13 for ; Mon, 06 Sep 2010 22:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=W7du0eGrd7aT14Yg2tUl85Fv0Ri6KSb8ZywZ5HTlz9c=; b=n1mR0B70hAnNyNax8bJaE970fwbobs/kBn6L3NQzi8beMpWOXbKIS+cWTMhtmpEDbf q0nuBdPQQccLKzyJMsO2MRaGFzIQI8lG3EQzEbdRC/WJgnyYTk4v+oSAOSMFBB5Ffujg DUwC5Y2wgASKcZaOjpLeC6DDcpcw5I0UQVJ0c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=jAWNEhdMLyfpJk7V5IaCZ77p5xSgJxtDk3ql584OGC8KAwui9qOowUOBj07UbeMD+6 jTGGhyekT7mXEqRVkCnlQVRmxxhlG/G+bKiGJtwdjOvqv858DHq5+FKV1TWhDI8Vz1h1 M2ZpDFoT8kGs8yri3D2caUWNHe5sCSljCpy+k= MIME-Version: 1.0 Received: by 10.204.76.205 with SMTP id d13mr513027bkk.93.1283836053116; Mon, 06 Sep 2010 22:07:33 -0700 (PDT) Received: by 10.204.80.167 with HTTP; Mon, 6 Sep 2010 22:07:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 Sep 2010 07:07:33 +0200 Message-ID: From: David DEMELIER To: dave jones Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: ACPI questions about press power button X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 05:07:34 -0000 2010/9/5 dave jones : > 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