fraserburnett
Posts: 2
Joined: Sat Sep 08, 2012 10:44 am

R-Pi shut down problem

Sat Sep 08, 2012 11:13 am

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 ?

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13101
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: R-Pi shut down problem

Sat Sep 08, 2012 11:26 am

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).

itimpi
Posts: 1090
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: R-Pi shut down problem

Sat Sep 08, 2012 11:35 am

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..

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: R-Pi shut down problem

Sat Sep 08, 2012 12:42 pm

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.

fraserburnett
Posts: 2
Joined: Sat Sep 08, 2012 10:44 am

Re: R-Pi shut down problem

Sun Sep 09, 2012 1:54 pm

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
.

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: R-Pi shut down problem

Sun Sep 09, 2012 2:00 pm

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.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13101
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: R-Pi shut down problem

Mon Sep 10, 2012 12:27 am

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.

tomc
Posts: 10
Joined: Thu Aug 30, 2012 11:47 pm
Location: US (Detroit)

Re: R-Pi shut down problem

Fri Sep 14, 2012 3:07 am

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

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: R-Pi shut down problem

Fri Sep 14, 2012 8:35 am

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.
Alex Eames RasPi.TV, RasP.iO

Evilsheep117
Posts: 15
Joined: Tue Sep 11, 2012 11:12 am
Location: Kingston Upon Thames

Re: R-Pi shut down problem

Fri Sep 14, 2012 9:08 am

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 ;)

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: R-Pi shut down problem

Fri Sep 14, 2012 9:40 am

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.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

Return to “Beginners”