openhab-distro
openhab-distro copied to clipboard
OpenHAB should be able to start with empty userdata folder
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
.
May the misc folder (#1205) could be used?
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.
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 Sounds like there is already an existing solution. Do you think it would be possible to integrate this mechanism into the openhab distro?
Sure it's possible. Someone just needs to find time to make it work (on all OS-es). :-)
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