PDA

View Full Version : command for quick shut down


iceman600
08-06-2008, 04:37 AM
what is the command for a quick shut down on x term?
im adding a quick shut down option on my personal menu for a quick reboot.... thanks

josiahg777
08-06-2008, 04:42 AM
oddly enough it's "shutdown" :P

It requires root though.

and reboot is either "shutdown -r" or "reboot"

qwerty12
08-06-2008, 04:58 AM
"shutdown -h now" as root

I prefer using "shutdown -r now" to reboot but IMHO, this is the best way to reboot:
run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.req_reboot

(That command uses the Nokia daemons to handle the reboot and anything written using libosso knows the tablet is about to restart and can do something about it. For example, the built in Notes app saved my unsaved note in a recovery file)

iceman600
08-06-2008, 05:01 AM
thank you guys... im still learning about linux. this is kinda new to me... im planing reformating my desktop and instal a gnome instead. thanks again


edit: the shutdown and shutdown -f now is not working at personal menu.
what command will i put at the COMMAND TO EXECUTE box for the qhick shutdown?

edit:i put these command and it just reboot...
rootsh shutdown -r now

josiahg777
08-06-2008, 05:48 AM
It should be "shutdown -h" or "shutdown -r"

also, make sure the "run as root" box is checked :)

iceman600
08-06-2008, 06:24 AM
shutdowm -h or shutdown -r doesnt work for me... there should be the word "now". and when i check run as root it doesnt work. so i uncheck it and works awsome.

so for newbies like me,
the command for personal menu for shutdown is
ROOTSH SHUTDOWN-H NOW

and for reboot it
ROOTSH SHUTDOWN-R NOW

josiahg777
08-06-2008, 06:58 AM
Hmmm funny, I've never had to include the "now"

it always worked with or without it... well, I'm glad to see you got it working :)

lma
08-06-2008, 09:34 AM
I prefer using "shutdown -r now" to reboot but IMHO, this is the best way to reboot:
run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.req_reboot


Thanks, useful to know!

The only reference I could find to this is in the SDK headers (/usr/include/mce/dbus-names.h specifically). Is there any other documentation?

IMHO there's no reason why shutdown couldn't also send an appropriate dbus signal (shutdown_ind perhaps?) via one of the init scripts' stop stanza (/etc/init.d/mce may be a good choice). Care to open a bug?

lma
08-06-2008, 10:01 AM
/etc/init.d/mce may be a good choice


Or maybe not, at that point both Xomap and dbus have gone away. /etc/init.d/zzinitend looks a bit better.

cvmiller
08-06-2008, 03:02 PM
Call me lazy, but I just use "init 6" (as root) to reboot. It is less typing.

Craig...

tehforum
08-07-2008, 08:51 PM
How would you save that command into a handy file on which you double click and it shutdown?

dfinch
08-07-2008, 09:43 PM
I use

sh -c 'echo reboot | sudo gainroot'

as a command in the osso-statusbar app command list. It works without complaint.
This was provided by someone else ~ so it's not original work.

nilchak
08-07-2008, 09:47 PM
With becomeroot installed on my N810 , the command
" shutdown -h now " didnt work in Personal menu - with or withour "run as root" checked.

So I uninstalled becomeroot and instead installed the newer roosh package.

Now running the command
" rootsh shutdown -h now " works fine in Personal menu 0 no need to check "run as root" option either.

Thanks for the tips.

gemniii42
09-06-2008, 10:33 PM
"shutdown -h now" as root

I prefer using "shutdown -r now" to reboot but IMHO, this is the best way to reboot:
run-standalone.sh dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.req_reboot

(That command uses the Nokia daemons to handle the reboot and anything written using libosso knows the tablet is about to restart and can do something about it. For example, the built in Notes app saved my unsaved note in a recovery file)

EXCELLENT!!
I slammed that into my PM and it worked as advertised, clean shutdown and reboot.
Tricks like this need to be accumulated.