But on every restart i get a FileNotFoundException for MapDB (No Permission)
I tried to change the permissions and also deleted the DB. It has been recreated.
But on reboot the same error occurs.
i am on a pi4 with openhabian 1.5.4
the openhab version is the latest and greatest 2.5.2-1
yes, MapDb has been installed via paperui
the user should be openhab, i guess. i do not know how to find out
2020-03-01 13:06:51.387 [ERROR] [org.openhab.persistence.mapdb ] - bundle org.openhab.persistence.mapdb:1.14.0 (262)[org.openhab.persistence.mapdb(277)] : The activate method has thrown an exception
java.io.IOError: java.io.FileNotFoundException: /var/lib/openhab2/persistence/mapdb/storage.mapdb (Keine Berechtigung)
at org.mapdb.Volume$FileChannelVol.(Volume.java:812) ~[?:?]
at org.mapdb.Volume.volumeForFile(Volume.java:202) ~[?:?]
at org.mapdb.Volume$1.createIndexVolume(Volume.java:276) ~[?:?]
at org.mapdb.StoreDirect.(StoreDirect.java:202) ~[?:?]
at org.mapdb.StoreWAL.(StoreWAL.java:74) ~[?:?]
at org.mapdb.DBMaker.extendStoreWAL(DBMaker.java:981) ~[?:?]
at org.mapdb.DBMaker.makeEngine(DBMaker.java:758) ~[?:?]
at org.mapdb.DBMaker.make(DBMaker.java:701) ~[?:?]
at org.openhab.persistence.mapdb.internal.MapDBPersistenceService.activate(MapDBPersistenceService.java:117) ~[?:?]
Off topic comment - it’s very easy to store and restore all Items. But do have a think about it - why would you want to do that? It costs little, but there is a cost, writing every change to a database etc.
I have exactly three Items I need to restore.
Sure, but remember you are restoring a guessed state. If there are security concerns then “not known yet” can be more appropriate, it’s usually only a case of writing your rules to take it into account. Just suggestions, it’s your system.
Window state CLOSED - secure.
Window state restored to CLOSED ? Well I don’t know, it was closed last time I heard but it might have changed while I was away. Plus, now I don’t know if it’s really closed or guessed closed.
Window state NULL - I don’t know yet, so can assume it’s insecure - if that’s important.
The problem seems to be tmpfs. I followed a tutorial lower writes on the sd card via tmpfs. additionally the logfiles and the mapdb files are copied away and then on reboot copied back. When this is done a chown and chmod command are used. However after startup everything ends up with “root” as owner.