Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

How to know when poweroff button is pressed

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
davidsb
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 146
Joined: Sun Dec 08, 2002 6:34 pm
Location: Lisbon, Portugal
Contact:
Contact davidsb
Website

How to know when poweroff button is pressed

  • Quote

Post by davidsb » Fri Nov 12, 2004 12:36 pm

How can you get a "signal" when the poweroff button is pressed, someway like in WinXP, when you press the poweroff button and windows automatically closes/kills apps and does a proper shutdown. Is this easy to acomplish in linux? You press the powerbutton off and shutdown is iniciated. How can one do that in linux?
http://recycler.homelinux.org/~wolfshade/bootlegs/
Top
Lupin_III
n00b
n00b
User avatar
Posts: 12
Joined: Thu Aug 05, 2004 10:00 am
Location: Unknown

  • Quote

Post by Lupin_III » Fri Nov 12, 2004 1:24 pm

If you use acpi is very simple.

Code: Select all

emerge acpid
Then you will find in /etc/acpid/events/power

Is the script that run when u press the power botton.

shutdown -h now in this file does the trick.



HTH
Top
SerfurJ
l33t
l33t
Posts: 824
Joined: Sat Apr 10, 2004 10:25 pm
Location: Texas

  • Quote

Post by SerfurJ » Sun Nov 28, 2004 7:09 pm

i don't have a /etc/acpid/events/power

all i have is:

Code: Select all

root # ls -R /etc/acpi/
/etc/acpi/:
default.sh  default.sh~  events

/etc/acpi/events:
default  default~
where do i add shutdown -h?
Top
davidsb
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 146
Joined: Sun Dec 08, 2002 6:34 pm
Location: Lisbon, Portugal
Contact:
Contact davidsb
Website

  • Quote

Post by davidsb » Wed Dec 01, 2004 2:58 pm

I also have the same doubt
http://recycler.homelinux.org/~wolfshade/bootlegs/
Top
atom
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 122
Joined: Mon Nov 25, 2002 11:10 am
Location: Columbus, Ohio, USA

  • Quote

Post by atom » Wed Dec 01, 2004 5:01 pm

you need to start the acpi init script

Code: Select all

/etc/init.d/acpi start
or

Code: Select all

rc-update add acpi default
the power button will be monitored by default and shutdown on press.
ubuntu.
Top
davidsb
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 146
Joined: Sun Dec 08, 2002 6:34 pm
Location: Lisbon, Portugal
Contact:
Contact davidsb
Website

  • Quote

Post by davidsb » Sat Dec 04, 2004 2:33 pm

I already have that started but can't see a /etc/acpid/events/power
Any thing missing?
http://recycler.homelinux.org/~wolfshade/bootlegs/
Top
Gentree
Watchman
Watchman
User avatar
Posts: 5350
Joined: Tue Jul 01, 2003 12:51 am
Location: France, Old Europe

  • Quote

Post by Gentree » Sun Dec 05, 2004 7:27 pm

I think he was suggesting adding the scritp called power with the command shutdown -h now in it.
8)
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Top
SerfurJ
l33t
l33t
Posts: 824
Joined: Sat Apr 10, 2004 10:25 pm
Location: Texas

  • Quote

Post by SerfurJ » Sun Dec 05, 2004 7:31 pm

i think he probably has an old version of acpid and the new location of
/etc/acpid/events/power is /etc/acpi/default.sh
Top
Gentree
Watchman
Watchman
User avatar
Posts: 5350
Joined: Tue Jul 01, 2003 12:51 am
Location: France, Old Europe

  • Quote

Post by Gentree » Sun Dec 05, 2004 8:36 pm

lupin wrote emerge acpid , correct.

Then he wrote :Then you will find in /etc/acpid/events/power

Either a slip or a different version . After a new emerge as above I have /etc/acpid/events

Atom wrote: /etc/init.d/acpi start

wrong , this should be acipd (note the d for daemon)

after that open /etc/acpi/events/default , read the comments, edit in the shutdown command and save as 'power'.

8)
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Top
SerfurJ
l33t
l33t
Posts: 824
Joined: Sat Apr 10, 2004 10:25 pm
Location: Texas

  • Quote

Post by SerfurJ » Sun Dec 05, 2004 9:12 pm

i don't have an /etc/acpid directory, only /etc/acpi. i get the idea now. thanks for translating. :)
Top
Post Reply

10 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic