Auto shutdown when idle...
-
Hello, I have my Pi 3 set up as a "videogame and media center" mostly for the kids. They mainly use the KODI addon, and sometimes the games.
I used to leave the Pi always on, but I had some problems because sometimes after a power outage, the SD card would get corrupted, and I'd have to reinstall it. But the kids can't be trusted to reliably shutdown the system after using it.
So I tried to setup KODI to auto shutdown when idle for a set time. It worked, and left the Pi on low-power standby (acceptable). But then if the power was cycled by a power outage, the Pi would boot up again and go to EmulationStation (not KODI), and it would stay there without the auto-shutdown of course.
So I tried to setup the system to automatically launch KODI at boot. That works, but when the KODI "times out" and tries to shutdown, it doesn't shutdown but just quits to ES.So I have two options:
1- Set it to boot into ES, then manually open KODI, the auto-shutdown works but if the power gets cycled it goes into ES (with the risk of corruption if there's a further power outage).
2- Set it to boot into KODI, but then the autoshutdown doesn't power down the system but merely exit to ES.Having an auto-shutdown feature in ES would solve the problem. Is it possible to enable such a feature? Or any other idea to have the system shutdown from KODI even if it is setup to boot into KODI?
Thank you,
Cristian -
@Quaxo76
https://askubuntu.com/questions/442795/how-to-shutdown-ubuntu-after-2-hours-of-idle
I will get around to testing this soon enough
sudo apt-get install xscreensaver
I can't guarantee it will work at all without an rtc or x screen(desktop). -
@Quaxo76 I think this is possible without additional software installation.
You can check for file in/dev/shm/runcommand.info
This file will be created if an emulator was started.
Or the timestamp of this file changes if there was annother emulator was started.So you check every 10minutes with a cron job and count file presence or file change ;)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.