Page 1 of 1

R-Pi shut down problem

Posted: Sat Sep 08, 2012 11:13 am
by fraserburnett
I'm a beginner and can't seem to get the shut down button to work. When I select "shut down" nothing happens. Anybody know if I am doing something wrong ? Is there a command on LXTerminal to shut the R-Pi down ?

Re: R-Pi shut down problem

Posted: Sat Sep 08, 2012 11:26 am
by mahjongg
Shut down button? Which shut down button, on the keyboard?
Most generic keyboard do not have a shutdown button, so such a thing is surely not supported!

To shut down from the command line do a:

sudo shutdown -h now

(sudo may or not be superfluous).

Re: R-Pi shut down problem

Posted: Sat Sep 08, 2012 11:35 am
by itimpi
From the command line I tend to use 'poweroff' rather than the 'shutdown' command. I suspect that is just a shell script wrapper for the shutdown command which is just slightly easier to use as it needs no parameters..

Re: R-Pi shut down problem

Posted: Sat Sep 08, 2012 12:42 pm
by amyren
I guess you are refering to the taskbar shutdown button.
Shutdown from the menubar in Raspian doesnt work to well here either.
Logout does work from the LXDE popup menu, and then you get to the terminal.
Then you can type sudo shutdown now, or offcourse you can open a terminal window directly and do it from the desktop.

But once at the terminal I have the bad habbit of just pulling the power plug :)
And I havent trashed my rootfs or experienced any trouble out of this yet, although its probably not recommended. I do have a recent backup of my sd card anyway, so its just a few minutes to restore it if something happens.

I wasnt aware of the poweroff script. Perhaps one can create a shortcut to it and make link to the desktop or menu entry for easy access.

Re: R-Pi shut down problem

Posted: Sun Sep 09, 2012 1:54 pm
by fraserburnett
Thanks, was referring to the shut down button from the LXDE logout session which I'd assumed was the standard way of fully closing down. However, have now used the LX Terminal comand as you suggested and pleased to say it does reliably close everything down. Thanks everybody for the help
.

Re: R-Pi shut down problem

Posted: Sun Sep 09, 2012 2:00 pm
by techpaul
fraserburnett wrote:Thanks, was referring to the shut down button from the LXDE logout session which I'd assumed was the standard way of fully closing down. However, have now used the LX Terminal comand as you suggested and pleased to say it does reliably close everything down. Thanks everybody for the help
.
There are a couple of command line 'shortcuts'

'restart' is the same as 'shutdown -r now'

'halt' is the same as 'shutdown -h now'

'man shutdown' is your friend on this one for those who want scripted shutdown control with a delay e.g. 10 minutes.

Re: R-Pi shut down problem

Posted: Mon Sep 10, 2012 12:27 am
by mahjongg
I suppose
sudo halt

would then be the shortest shutdown command?!

I wished it would be mentioned in the bootup text, same as mentioning that startx starts the GUI.
I think that many new PI users would simply "pull the plug", as they have no clue how to shutdown the thing cleanly, even exiting the GUI just brings you back to the command prompt.

Re: R-Pi shut down problem

Posted: Fri Sep 14, 2012 3:07 am
by tomc
So,....what is the correct method to shutdown the RPi?

I am concerned as I've used two images now that end up corrupted after using for several days.

I assumed on the first one that i was not shutting it down properly.

With this second one, I am being most careful to use 'shutdown now'.

Is 'poweroff' a better method?

Is there a document/book that details such basic usage?

thank you,
TomC

Re: R-Pi shut down problem

Posted: Fri Sep 14, 2012 8:35 am
by alexeames
tomc wrote:So,....what is the correct method to shutdown the RPi?

I am concerned as I've used two images now that end up corrupted after using for several days.

I assumed on the first one that i was not shutting it down properly.

With this second one, I am being most careful to use 'shutdown now'.

Is 'poweroff' a better method?

Is there a document/book that details such basic usage?

thank you,
TomC
With RasPi.TV I am attempting to build up a collection of such basic things in a foolproof, easy to follow manner. Basically I'm blogging about things as I figure out/learn/discover them for myself, trying to make sure the instructions are complete.

I already covered shutting down and rebooting here...

http://raspi.tv/2012/how-to-safely-shut ... spberry-pi

sudo shutdown -h now
or sudo halt are fine. Wait until a few seconds after the leds go out (apart from the red one) before you pull the plug on the power.

If your Pi crashes during some process or other, instead of yanking the power, ssh into it from another machine and shut it down from there.

If you pull the power while it's trying to write to the SD card, you can corrupt the card.

Re: R-Pi shut down problem

Posted: Fri Sep 14, 2012 9:08 am
by Evilsheep117
I pulled the plug a few times and i've had to re-image my SD card a few times too :lol:

I've been using sudo poweroff without any problems :D I just have a small piece of paper with useful commands on it, eventually i'll remember them ;)

Re: R-Pi shut down problem

Posted: Fri Sep 14, 2012 9:40 am
by Dweeber
Evilsheep117 wrote:I pulled the plug a few times and i've had to re-image my SD card a few times too :lol:

I've been using sudo poweroff without any problems :D I just have a small piece of paper with useful commands on it, eventually i'll remember them ;)
For other users, I create a "menu" command. Located in /usr/local/bin is is just a simple shell script:

Code: Select all

echo
echo Menu of Stuff
echo ==========================================================================
cat <<EOF
Omxplayer .................. omxplayer -o hdmi filename.mp4
Locations of Stuff ......... locations
Turn On VNC server ......... vncserver :1 -geometry 1280x800 -depth 24
Switch to Videos ........... vidoes
Switch to /etc/network ..... networks
Status of Stuff ............ status
Shutdown System ............ sync;halt
EOF
echo
chmod 0755 /usr/local/bin/menu

You can add whatever tidbits you need to remember, no pieces of paper... You can of course create your own scripts or alias commands to do stuff too...

alias rebootsys='sudo reboot'

added to .bashrc will reboot the system by typing rebootsys ... root or not.