You are not logged in.

#1 2004-10-28 20:29:45

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Feeling lazy?

I always thought that typing "shutdown -h now" (or even "halt") in a terminal was too much for me. So many letters to type! smile

I just found a nicer way to turn off my Arch Linux box.

1) pacman -Sy acpid
2) create a file named /etc/acpi/events/power with the following content:

# shutdown when pressing power off

event=button/power.*
action=/sbin/shutdown -h now

3) /etc/rc.d/acpid start

Now you can turn off your computer by simply pressing power off.

(Yawn) Time to go to sleep...  wink

Offline

#2 2004-10-28 21:05:53

KalephOne
Member
From: Fortaleza, Brasil
Registered: 2004-04-02
Posts: 99

Re: Feeling lazy?

Very nice. Freebsd have this feature and I always wondered how to do it on linux.
Thanks a lot  big_smile


Kaleph
jabber: kaleph@jabber.org

Offline

#3 2004-10-28 21:36:46

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Feeling lazy?

I agree - nice tip... throw this in the wiki if ya want

Offline

#4 2004-10-29 14:29:42

ravster
Member
From: Queen's U, Kingston, Canada
Registered: 2004-05-02
Posts: 285
Website

Re: Feeling lazy?

You mean with this I can simply press the power button on my cpu and the computer will go into a clean/soft/whatever shutdown? Without giving me any problems on the hard disk? :!: :?: :shock:

Offline

#5 2004-10-29 15:31:21

rehcra
Member
From: Distant galaxy
Registered: 2004-09-15
Posts: 120
Website

Re: Feeling lazy?

You still can have some problems if you don't close KDE/GNOME/other apps properly.


http://pdfinglis.tripod.com/widget.html
"In order to make an apple pie from scratch, you must first create the universe."
                                 -- Carl Sagan, Cosmos

Offline

#6 2004-10-29 15:49:25

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Feeling lazy?

rehcra wrote:

You still can have some problems if you don't close KDE/GNOME/other apps properly.

if you can get suspend-to-disc working and have it hibernate on button press - which persists everything to your swap partition

Offline

#7 2004-10-29 18:28:19

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: Feeling lazy?

It looks like the wiki is broken at the moment, i can't access to some links sad

So i just filed a feature request:  smile

http://bugs.archlinux.org/index.php?do=details&id=1702

Offline

#8 2004-10-29 19:30:53

rehcra
Member
From: Distant galaxy
Registered: 2004-09-15
Posts: 120
Website

Re: Feeling lazy?

phrakture: I wouldn't recommend software suspend to anybody beacuse it is extremely unstable. It actually destroyed my previous shiny Gentoo system with it. This is why I gave Arch a try...

Or wait! I recommend software suspend to those using Gentoo system! This way they will switch to Arch faster smile


http://pdfinglis.tripod.com/widget.html
"In order to make an apple pie from scratch, you must first create the universe."
                                 -- Carl Sagan, Cosmos

Offline

#9 2004-10-29 20:09:33

LavaPunk
Member
Registered: 2004-03-05
Posts: 129

Re: Feeling lazy?

Bummer... this didn't do anything for me.  Perhaps it has to supported by your kernel? (I roll my own) or my hardware is just teh suck.

Offline

#10 2004-10-29 20:29:24

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: Feeling lazy?

I am simply using the precompiled kernel26 package of Arch. I believe that the only requirement is to have ACPI compiled in. You can check it by verifying that you have a /proc/acpi directory tree.

Maybe the logs in /var/log/acpid could help you to find out why  the poweroff event could not be properly handled?

Offline

#11 2004-10-29 20:49:56

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Feeling lazy?

rehcra wrote:

phrakture: I wouldn't recommend software suspend to anybody beacuse it is extremely unstable.

there's a patch - the swsup in the kernel sucks... the new one is called swsup2 and should be merged in in the near future....

about this not doing anything - append "acpi=on" to your kernel boot line

Offline

#12 2004-10-29 21:06:06

LavaPunk
Member
Registered: 2004-03-05
Posts: 129

Re: Feeling lazy?

Appending "acpi=on" didn't do the trick.  And I do have acpi enabled in my kernel.   /var/log/acpid just says:

[Fri Oct 29 14:03:20 2004] starting up
[Fri Oct 29 14:03:20 2004] 1 rule loaded

No help there.  Finally my rule looks like this:
/etc/acpi/events/power:

event=button/power.*
action=/sbin/halt

Having "action=/sbin/shutdown -h now"

Didn't do it either...

Offline

#13 2004-10-29 21:50:03

rehcra
Member
From: Distant galaxy
Registered: 2004-09-15
Posts: 120
Website

Re: Feeling lazy?

phrakture wrote:
rehcra wrote:

phrakture: I wouldn't recommend software suspend to anybody beacuse it is extremely unstable.

there's a patch - the swsup in the kernel sucks... the new one is called swsup2 and should be merged in in the near future....

I tried each of 3 implementations of suspending. EACH didn't work properly on my machine. From time to time the system wasn't restored properly. One of the implementations shut down my hardisk TWICE, resulting in a longer poweroff time than neccessary. Finally, my filesystem was corrupted. And swsup2 you are talking about didn't support SMP at that time (I don't know if this has changed).
I consider the current version on swsup (and alternatives) a shit. Just like propertial ATI drivers are a shit.
I don't want to sacrifice stability only because I'm lazy.


http://pdfinglis.tripod.com/widget.html
"In order to make an apple pie from scratch, you must first create the universe."
                                 -- Carl Sagan, Cosmos

Offline

#14 2004-10-29 22:59:50

cbozic
Member
From: Morgantown, WV, USA
Registered: 2004-01-31
Posts: 77

Re: Feeling lazy?

Laziness is good with computers!  Thanks for the tip!  It works like a charm.

Offline

#15 2004-10-30 04:10:32

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Feeling lazy?

I just alias'ed 'sudo shutdown -h now' to something simple..
like.... bonk
I have sudo for my user account on my home box to only ask for pass once per session...and I generally use it long before shutdown..


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#16 2004-10-30 05:07:34

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

Re: Feeling lazy?

you just took my desktop a further step in being a windows clone  :?

nice stuff never the less wink

Offline

#17 2004-10-30 08:25:16

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: Feeling lazy?

LavaPunk wrote:

Appending "acpi=on" didn't do the trick.  And I do have acpi enabled in my kernel.   /var/log/acpid just says:

[Fri Oct 29 14:03:20 2004] starting up
[Fri Oct 29 14:03:20 2004] 1 rule loaded

Here is my /var/log/acpid:

[Thu Oct 28 22:15:23 2004] starting up
[Thu Oct 28 22:15:23 2004] 1 rule loaded
[Thu Oct 28 23:37:25 2004] received event "button/power PWRF 00000080 00000001"
[Thu Oct 28 23:37:25 2004] executing action "/sbin/shutdown -h now"
[Thu Oct 28 23:37:25 2004] BEGIN HANDLER MESSAGES
[Thu Oct 28 23:37:26 2004] END HANDLER MESSAGES
[Thu Oct 28 23:37:26 2004] action exited with status 0
[Thu Oct 28 23:37:26 2004] completed event "button/power PWRF 00000080 00000001"
[Thu Oct 28 23:37:27 2004] exiting
[Fri Oct 29 20:01:56 2004] starting up
[Fri Oct 29 20:01:56 2004] 1 rule loaded
[Fri Oct 29 23:11:36 2004] received event "button/power PWRF 00000080 00000001"
[Fri Oct 29 23:11:36 2004] executing action "/sbin/shutdown -h now"
[Fri Oct 29 23:11:36 2004] BEGIN HANDLER MESSAGES
[Fri Oct 29 23:11:36 2004] END HANDLER MESSAGES
[Fri Oct 29 23:11:36 2004] action exited with status 0
[Fri Oct 29 23:11:36 2004] completed event "button/power PWRF 00000080 00000001"
[Fri Oct 29 23:11:39 2004] exiting
[Sat Oct 30 09:49:01 2004] starting up
[Sat Oct 30 09:49:01 2004] 1 rule loaded

It looks like your acpid properly loads the /etc/acpi/events/power file. However it never catches the poweroff ACPI event. I would say it comes either from the ACPI kernel layer or from your hardware.

If you have Windows installed on your PC, you could test if the poweroff button is propely handled by Windows. If not, your hardware is not ACPI compatible: bad luck . If it is, the problem probably comes from the ACPI kernel layer.

In the last case, you should test ACPI with an unmodified Arch kernel26 package. If it works there - the ACPI layer is   broken in your homebuilt kernel.

If it still does not work... maybe you should get in touch with upstream ACPI (kernel, acpid) devs. Or check google with something like linux+ACPI+problem+your_motherboard_model :?.

I am using this tip on 2 PCs: one recent P4 2.8Gz (Dell), and one older Athlon 800Mhz (Via chipset). It works flawlessly on both. smile

Offline

#18 2004-10-30 23:57:37

LavaPunk
Member
Registered: 2004-03-05
Posts: 129

Re: Feeling lazy?

It appears it's my hardware.   I'm not really bummed about it... but still... stupid hardware. smile

Offline

Board footer

Powered by FluxBB