Maybe I’m getting off track. My original problem was with restart. If I use Exit, sometimes OSMC does not re-launch. If I use Restart, it always relaunches, but sometimes it loses my settings. I don’t think the settings it loses are only in guisettings.xml but also in the addon folder for the MQ7 skin (many xml files)
I need the system to restart so I can test adjustments to the config.txt that I’m attempting to optimize for my uses.
I need the system to shut down because it’s plugged into the same power bar as other devices which need to be shut down daily. Not really many options there unless I run another extension cord just for the Pi.
EDIT: Feb 10
The recent update which claims to reduce this problem has not reduced it for me. I created some addons to replace the “restart” and “shutdown” functions.
They depend on “at” being installed.
sudo apt-get update
sudo apt-get install at
Each addon zip contains three files:
addon.py (same for both)
import xbmcaddon
import os
addon = xbmcaddon.Addon()
cwd = addon.getAddonInfo('path')
os.system('at -f '+os.path.join(cwd, 'addon.sh now'))
addon.xml (the following is for Shutdown… edit in four places for the restart version
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.shutdown.now" name="Shutdown Now" version="0.0.1" provider-name="Me">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
<extension point="xbmc.python.script" library="addon.py">
<provides>executable</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_gb">Shuts it down now</summary>
<description lang="en_gb">No really, it shuts it down now</description>
<disclaimer lang="en_gb"></disclaimer>
<language></language>
<platform>all</platform>
<license></license>
<forum></forum>
<website></website>
<email></email>
<source></source>
<news></news>
<assets>
<icon></icon>
<fanart></fanart>
<screenshot></screenshot>
</assets>
</extension>
</addon>
addon.sh (insert -r after shutdown for restart)
sudo systemctl stop mediacenter
(sleep 20 ; sudo shutdown now) &
While I’ve never encountered a problem using this method, it could just be luck… but it’s what I’m using now instead of the default Shutdown and Restart (or Exit).
Of course, as I discovered, this doesn’t stop someone else from shutting down the system the bad way, via Yatse (or ssh too probably), and corrupting the data. I hope this gets fixed soon. There is apparently a way a program can tell the shutdown process that it isn’t ready to shutdown yet…