googlecreativelab / coder

A simple way to make web stuff on Raspberry Pi
http://goo.gl/coder
Apache License 2.0
2.42k stars 275 forks source link

clean reboot? #6

Open kristofer opened 10 years ago

kristofer commented 10 years ago

we need to add a shutdown button to the main coder app. otherwise, it's only a matter of a few unpluggings and the SD card to hosed, right?

WebReflection commented 10 years ago

there is a reboot, it should be easy to put a shutdown too with same privileges, shutdown -h now instead of -r, and spawn('sudo_script/shutdown') through any button/link/url you want.

jmstriegel commented 10 years ago

In practice, as long as you don't unplug your device right as you're saving a project, I don't think you'll have a problem.

If you actually encounter an issue here, let me know and I'll work this in. WebReflection has the right track here if you'd like to go ahead and play with adding this. Just make a shutdown script in the sudo_scripts folder.

Once you have the script in place (you'll have to do that bit manually), you can actually play around with how the main landing page works right in the coder editor. Just go to /app/editor/edit/coder. The wifi app is the only piece right now that does rebooting, if you want to look at that for reference (/app/editor/edit/wifi).

richard-tx commented 10 years ago

I have been unplugging my Rpis daily for well over a year without incident. I have had problems with cheap SD cards being destroyed, but ever since I started using Toshiba Exceria cards, I have not had a single failure.