openhab-distro icon indicating copy to clipboard operation
openhab-distro copied to clipboard

OpenHAB should be able to start with empty userdata folder

Open spacemanspiff2007 opened this issue 4 years ago • 6 comments

Currently userdata (especially userdata/etc) holds configuration information. When deleting everything inside of userdata to create a fresh installation openhab will crash. This is highly unintuitive because one would expect that cleaning all userdata will lead to a fresh installation.

All required structure and data under userdata should be created on startup. Since userdata/etc this data is more a static configuration I propose moving it to runtime.

spacemanspiff2007 avatar Oct 26 '20 07:10 spacemanspiff2007

May the misc folder (#1205) could be used?

spacemanspiff2007 avatar Dec 11 '20 04:12 spacemanspiff2007

When designing this directory structure, we were constrained to what can be done with Karaf. The folder userdata/etc is what Karaf requires to be writable, hence it cannot be moved to runtime, although I would have preferred that as well.

We could think of changing the start scripts to identify an empty userdata folder and copy all required content there (from some other "internal" place) before launching Karaf.

kaikreuzer avatar Dec 11 '20 13:12 kaikreuzer

Just use the Docker container and it will already work like that. :wink:

It relocates the default content of conf and userdata to a dist dir so it can use it for updating existing files in volumes. When the volumes are empty they are initialized when the container starts.

wborn avatar Dec 11 '20 14:12 wborn

@wborn Sounds like there is already an existing solution. Do you think it would be possible to integrate this mechanism into the openhab distro?

spacemanspiff2007 avatar Dec 11 '20 16:12 spacemanspiff2007

Sure it's possible. Someone just needs to find time to make it work (on all OS-es). :-)

wborn avatar Dec 11 '20 18:12 wborn

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-0-wishlist/142388/171

openhab-bot avatar Jan 03 '23 16:01 openhab-bot