linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: "Grover, Andrew" <andrew.grover@intel.com>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	"Acpi-linux (E-mail)" <acpi@phobos.fachschaften.tu-muenchen.de>
Subject: Re: Let init know user wants to shutdown
Date: Wed, 11 Apr 2001 14:20:13 +0200	[thread overview]
Message-ID: <20010411142012.C32104@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <4148FEAAD879D311AC5700A0C969E8905DE817@orsmsx35.jf.intel.com>
In-Reply-To: <4148FEAAD879D311AC5700A0C969E8905DE817@orsmsx35.jf.intel.com>; from andrew.grover@intel.com on Tue, Apr 10, 2001 at 10:05:13AM -0700

Hi!

> This is not correct, because we want the power button to be configurable.
> The user should be able to redefine the power button's action, perhaps to
> only sleep the system. We currently surface button events to acpid, which
> then can do the right thing, including a shutdown -h now (which I assume
> notifies init).

There's no problem with configurability -- you can configure init as
well. I saw it pretty much analogic to situation with Ctrl-Alt-Del: it
also sends signal to init. Init then decides what to do. [I believe
requiring acpid for such easy stuff is not neccessary...]
								Pavel


> Regards -- Andy
> 
> > From: Pavel Machek [mailto:pavel@suse.cz]
> > Init should get to know that user pressed power button (so it can do
> > shutdown and poweroff). Plus, it is nice to let user know that we can
> > read such event. [I hunted bug for few hours, thinking that kernel
> > does not get the event at all].
> > 
> > Here's patch to do that. Please apply,
> > 								Pavel
> > 
> > diff -urb -x .dep* -x .hdep* -x *.[oas] -x *~ -x #* -x *CVS* 
> > -x *.orig -x *.rej -x *.old -x .menu* -x asm -x local.h -x 
> > System.map -x autoconf.h -x compile.h -x version.h -x 
> > .version -x defkeymap.c -x uni_hash.tbl -x zImage -x vmlinu?* 
> > -x TAGS -x bootsect -x *RCS* -x conmakehash -x map -x build 
> > -x build -x configure -x *target* -x *.flags -x *.bak 
> > clean/drivers/acpi/events/evevent.c 
> > linux/drivers/acpi/events/evevent.c
> > --- clean/drivers/acpi/events/evevent.c	Sun Apr  1 00:22:57 2001
> > +++ linux/drivers/acpi/events/evevent.c	Wed Apr  4 01:08:11 2001
> > @@ -30,6 +30,8 @@
> >  #include "acnamesp.h"
> >  #include "accommon.h"
> >  
> > +#include <linux/signal.h>
> > +
> >  #define _COMPONENT          EVENT_HANDLING
> >  	 MODULE_NAME         ("evevent")
> >  
> > @@ -197,14 +172,18 @@
> >  	if ((status_register & ACPI_STATUS_POWER_BUTTON) &&
> >  		(enable_register & ACPI_ENABLE_POWER_BUTTON))
> >  	{
> > +		printk ("acpi: Power button pressed!\n");
> > +		kill_proc (1, SIGTERM, 1);
> >  		int_status |= acpi_ev_fixed_event_dispatch 
> > (ACPI_EVENT_POWER_BUTTON);
> >  	}
> >  
> > +
> >  	/* sleep button event */
> >  
> >  	if ((status_register & ACPI_STATUS_SLEEP_BUTTON) &&
> >  		(enable_register & ACPI_ENABLE_SLEEP_BUTTON))
> >  	{
> > +		printk("acpi: Sleep button pressed!\n");
> >  		int_status |= acpi_ev_fixed_event_dispatch 
> > (ACPI_EVENT_SLEEP_BUTTON);
> >  	}
> >  
> > 
> > -- 
> > I'm pavel@ucw.cz. "In my country we have almost anarchy and I 
> > don't care."
> > Panos Katsaloulis describing me w.r.t. patents at 
> > discuss@linmodems.org
> > 

-- 
The best software in life is free (not shareware)!		Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+

  parent reply	other threads:[~2001-04-11 12:20 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 17:05 Let init know user wants to shutdown Grover, Andrew
2001-04-11  4:23 ` John R Lenton
2001-04-11 14:59   ` John Fremlin
2001-04-11 12:20 ` Pavel Machek [this message]
2001-04-11 15:10   ` John Fremlin
2001-04-11 14:56 ` John Fremlin
  -- strict thread matches above, loose matches on Subject: below --
2001-04-18 22:52 Grover, Andrew
2001-04-26 22:10 ` David S. Miller
2001-04-18 21:46 Grover, Andrew
2001-04-18 22:09 ` David S. Miller
2001-04-18 22:30 ` John Fremlin
2001-04-19  2:16 ` Jeff Garzik
2001-04-19 12:04 ` David Woodhouse
2001-04-18 18:28 Grover, Andrew
2001-04-18 18:45 ` Jeff Garzik
2001-04-18 19:36 ` John Fremlin
2001-04-18  0:07 Grover, Andrew
2001-04-18  0:51 ` Alan Cox
2001-04-18  1:56   ` John Fremlin
2001-04-18 11:55     ` Alan Cox
2001-04-18 19:10       ` John Fremlin
2001-04-18 20:10         ` Alan Cox
2001-04-18 20:21           ` John Fremlin
2001-04-18 21:05           ` Avery Pennarun
2001-04-18 21:34             ` John Fremlin
2001-04-20 17:02         ` Pavel Machek
2001-05-02 16:52           ` John Fremlin
2001-04-20 17:01     ` Pavel Machek
2001-04-20 23:41       ` John Fremlin
2001-04-21  7:54         ` Pavel Machek
2001-04-24  0:17         ` Jamie Lokier
2001-04-24  1:08           ` John Fremlin
2001-04-24 10:06           ` Pavel Machek
2001-04-25 14:28             ` Jamie Lokier
2001-04-25 16:11             ` Richard Gooch
2001-04-18  1:54 ` John Fremlin
2001-04-17 16:45 Grover, Andrew
2001-04-17 19:54 ` Pavel Machek
2001-04-17 22:23 ` John Fremlin
2001-04-18 15:26 ` Simon Richter
2001-04-18 19:51   ` John Fremlin
2001-04-16 23:32 Grover, Andrew
2001-04-17  6:40 ` John Fremlin
2001-04-17  6:41 ` Simon Richter
2001-04-17 11:16 ` Pavel Machek
2001-04-12 17:25 David Balazic
2001-04-16  7:03 ` Pavel Machek
2001-04-11 17:06 Grover, Andrew
2001-04-11 18:29 ` John Fremlin
2001-04-11  4:31 alad
2001-04-04 22:02 Pavel Machek
2001-04-10 23:20 ` Miquel van Smoorenburg
2001-04-10 23:30   ` Miquel van Smoorenburg
2001-04-10 23:38   ` Kurt Roeckx
2001-04-10 23:46     ` Kurt Roeckx
2001-04-10 23:53     ` Miquel van Smoorenburg
2001-04-10 23:41   ` Mike Castle
2001-04-13  0:29     ` Pavel Machek
2001-04-16 12:42       ` Simon Richter
2001-04-16 15:49         ` Andreas Ferber
2001-04-16 16:25           ` Simon Richter
2001-04-16 21:27             ` Pavel Machek
2001-04-16 21:44               ` Simon Richter
2001-04-16 22:38                 ` Andreas Ferber
2001-04-17  6:16                   ` Simon Richter
2001-04-17  8:39                     ` Andreas Ferber
2001-04-17 14:09                       ` Simon Richter
2001-04-16 21:36         ` Ben Ford
     [not found] ` <9b04food@ncc1701.cistron.net>
     [not found]   ` <9b052eod@ncc1701.cistron.net>
2001-04-13  0:26     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010411142012.C32104@atrey.karlin.mff.cuni.cz \
    --to=pavel@suse.cz \
    --cc=acpi@phobos.fachschaften.tu-muenchen.de \
    --cc=andrew.grover@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).