PDA

View Full Version : Shut Down...



kagenotatsu
16th May 2008, 01:40 AM
Two questions:

1. Does anybody know what command is run when you click "Shut Down..." in main gnome menu?

I have no idea how to find this, but think it would be useful to be able to run this from a script.

2. Does anybody know how to configure my power button to run the above "Shut Down..." command.

As of now, when I press my physical power button on my case, it behaves similarly to the "Log Out..." command from the gnome menu, except it does not self time out.

Right now the power button is basically dead, since I'm the only one using this machine, so logging out without wanting to shutdown/restart/suspend/hibernate is quite rare, and it would be incredibly useful for me to have this button bound to prompt me like the menu does.

I've already tried google, but most of the stuff I've found is people having problems with ACPI.

Thanks in advance.

bob
16th May 2008, 01:47 AM
The command is "poweroff" and you can certainly configure a launcher for that.

kagenotatsu
16th May 2008, 02:16 AM
Poweroff shuts down the machine immediately, does it not?

I mean the prompt you get when you open up the gnome menu and get "Shut down this system now?"

And then options for Shutdown, Restart, Hibernate, etc.

bob
16th May 2008, 02:27 AM
Sorry, too many threads, not reading carefully... Ah well, it gave the question a 'bump' if not an answer.

Dan
16th May 2008, 03:50 AM
I've spent the last twenty minutes trying to hunt that down, and it's like tyring to find your way through a poorly designed county courthouse! Stuff leads here, sends you off to there, refers back here, then there, then dead-ends in a blank directory! <..http://www.zianet.com/ZYLOO/smileys/disgusted.gif..>

Wayne
16th May 2008, 03:56 AM
Try:

shutdown


[wayne@Beerislife ~]$ su -
Password:
[root@Beerislife ~]# shutdown
Usage: shutdown [-akrhHPfnc] [-t secs] time [warning message]
-a: use /etc/shutdown.allow
-k: don't really shutdown, only warn.
-r: reboot after shutdown.
-h: halt after shutdown.
-P: halt action is to turn off power.
-H: halt action is to just halt.
-f: do a 'fast' reboot (skip fsck).
-F: Force fsck on reboot.
-n: do not go through "init" but go down real fast.
-c: cancel a running shutdown.
-t secs: delay between warning and kill signal.
** the "time" argument is mandatory! (try "now") **

Wayne

Dan
16th May 2008, 04:15 AM
Well that's just way too dang easy!

Wayne
16th May 2008, 04:17 AM
Well that's just way too dang easy!

Right, let's dig in and find a more convoluted way of doing it :D

Wayne

Dan
16th May 2008, 04:53 AM
Well, dammit, man! If'n it was easy, everybody would be doing it!

Uh ... Wait a minnit! <..:p..>