Mapdb doesn't restoreOnStartup

yes, openHABian seems to do what it’s supposed to. does openhab-cli backup/restore somehow mess with ZRAM?

[12:02:13] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 24.8M 87.1K  388K       4 /opt/zram/zram2
/dev/zram1 lzo-rle       500M 16.4M  7.1K   84K       4 /opt/zram/zram1
/dev/zram0 lzo-rle       600M    4K   87B   12K       4 [SWAP]
[12:02:42] root@oha2:/home/openhabian# openhab-cli backup
...
Success! Backup made in /var/lib/openhab2/backups/openhab2-backup-20_07_31-12_03_29.zip // i made a "empty" backup so the path is created
[12:06:07] root@oha2:/home/openhabian# systemctl stop openhab2
Warning: The unit file, source configuration file or drop-ins of openhab2.service changed on disk. Run 'systemctl daemon-reload' to reload units.
[12:06:38] root@oha2:/home/openhabian# openhab-cli restore /var/lib/openhab2/backups/openhab2-backup-20_07_27-18_13_18.zip // this i my "real" backup
...
Backup successfully restored!
[12:06:57] root@oha2:/home/openhabian# systemctl start openhab2
Warning: The unit file, source configuration file or drop-ins of openhab2.service changed on disk. Run 'systemctl daemon-reload' to reload units.
[12:09:03] root@oha2:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 25.6M 374.3K  792K       4
[12:10:12] root@oha2:/home/openhabian#

no it should not. See if that happens without openhab-cli, too.

well, i’ll have to start again when i’m home from work. can’t switch sd card form work :grinning:
mahlzeit

What are you doing with different SD cards?
You must not run diagnosis on one and change the other, that’s giving absolutely misleading results! :roll_eyes:

i was planning to shutdown the current alpha-system, write the clean openHABian setup to that card same and start over.

Edit /etc/systemd/system/openhab2.service.d/override.conf to look like below and run systemctl daemon-reload, then retry what you did with openhab-cli, including oh2 stop/start

[Unit]
Description=openHAB2 instance, reachable at http://%H:8080
Wants=zram-config.service
Wants=frontail.service

[Service]
ExecStartPre=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.rules" -exec /usr/bin/rename.ul .rules .x {} \\;'
ExecStartPost=-/bin/sleep 120
ExecStartPost=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.x" -exec /usr/bin/rename.ul .x .rules {} \\;'
TimeoutStartSec=240

that means i’ll install bindings manually and restore/copy my files form a previous backup?

edit: on my acutal alpha setup or on a fresh openHABian? :no_mouth:

it’s just about stop-start-OH2 to see if ZRAM is started again. So you can omit openhab-cli and I don’t care where, you can use the alpha setup, too

ok, here goes…

clean openHABian 1.6a, changes to override as in your post.

[19:23:19] root@openhab:/home/openhabian# systemctl status zram-config
● zram-config.service - zram-config
   Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor pres
   Active: active (exited) since Fri 2020-07-31 19:16:48 CEST; 8min ago
  Process: 239 ExecStartPre=/bin/rm -f /usr/local/share/zram-config/zram-device-
  Process: 266 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0
 Main PID: 266 (code=exited, status=0/SUCCESS)

Jul 31 19:16:48 openhab zram-config[266]: + chmod 755 /opt/zram/zram2/upper /opt
Jul 31 19:16:48 openhab zram-config[266]: + echo 'log                /zram2
Jul 31 19:16:48 openhab zram-config[266]: + invoke-rc.d rsyslog start
Jul 31 19:16:48 openhab zram-config[266]: + invoke-rc.d nginx start
Jul 31 19:16:48 openhab zram-config[266]: + journalctl --flush
Jul 31 19:16:48 openhab zram-config[266]: + '[' '!' -z '' ']'
Jul 31 19:16:48 openhab zram-config[266]: + echo 'createZlog no oldlog dir in zt
Jul 31 19:16:48 openhab zram-config[266]: + read -r line
Jul 31 19:16:48 openhab zram-config[266]: + '[' false = true ']'
Jul 31 19:16:48 openhab systemd[1]: Started zram-config.
[19:25:57] root@openhab:/home/openhabian# systemctl status openhab2
Warning: The unit file, source configuration file or drop-ins of openhab2.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● openhab2.service - openHAB2 instance, reachable at http://openhab:8080
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/openhab2.service.d
           └─override.conf
   Active: active (running) since Fri 2020-07-31 19:22:55 CEST; 3min 17s ago
     Docs: https://www.openhab.org/docs/
           https://community.openhab.org
  Process: 656 ExecStartPre=/bin/bash -c /usr/bin/find ${OPENHAB_CONF} -name "*.rules" -exec /usr/bin/rename.ul .rules .x {} \; (code=exited, status=0/SUCCESS)
  Process: 662 ExecStartPost=/bin/sleep 120 (code=exited, status=0/SUCCESS)
  Process: 919 ExecStartPost=/bin/bash -c /usr/bin/find ${OPENHAB_CONF} -name "*.x" -exec /usr/bin/rename.ul .x .rules {} \; (code=exited, status=0/SUCCESS)
 Main PID: 661 (java)
    Tasks: 86 (limit: 4915)
   CGroup: /system.slice/openhab2.service
           └─661 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/

Jul 31 19:16:57 openhab systemd[1]: Starting openHAB2 instance, reachable at http://openhab:8080...
Jul 31 19:22:55 openhab systemd[1]: Started openHAB2 instance, reachable at http://openhab:8080.

now i’ll make an image of the sd card. then proceed with openhab-cli restore.

okay, after boot:

[21:00:25] root@openhab:/home/openhabian# systemctl status zram-config
● zram-config.service - zram-config
   Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor preset: enabled)
   Active: active (exited) since Fri 2020-07-31 20:59:21 CEST; 1min 17s ago
  Process: 239 ExecStartPre=/bin/rm -f /usr/local/share/zram-config/zram-device-list /usr/local/share/zram-config/zram-device-list.rev (code=exited, status=0/SUCCESS)
  Process: 257 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0/SUCCESS)
 Main PID: 257 (code=exited, status=0/SUCCESS)

Jul 31 20:59:20 openhab zram-config[257]: + chmod 755 /opt/zram/zram2/upper /opt/zram/zram2/workdir /var/log
Jul 31 20:59:20 openhab zram-config[257]: + echo 'log                /zram2                /var/log                /log.bind'
Jul 31 20:59:20 openhab zram-config[257]: + invoke-rc.d rsyslog start
Jul 31 20:59:20 openhab zram-config[257]: + invoke-rc.d nginx start
Jul 31 20:59:21 openhab zram-config[257]: + journalctl --flush
Jul 31 20:59:21 openhab zram-config[257]: + '[' '!' -z '' ']'
Jul 31 20:59:21 openhab zram-config[257]: + echo 'createZlog no oldlog dir in ztab'
Jul 31 20:59:21 openhab zram-config[257]: + read -r line
Jul 31 20:59:21 openhab zram-config[257]: + '[' false = true ']'
Jul 31 20:59:21 openhab systemd[1]: Started zram-config.
[21:01:12] root@openhab:/home/openhabian# systemctl status openhab2
Warning: The unit file, source configuration file or drop-ins of openhab2.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● openhab2.service - openHAB2 instance, reachable at http://openhab:8080
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/openhab2.service.d
           └─override.conf
   Active: active (running) since Fri 2020-07-31 21:01:43 CEST; 7s ago
     Docs: https://www.openhab.org/docs/
           https://community.openhab.org
  Process: 632 ExecStartPre=/bin/bash -c /usr/bin/find ${OPENHAB_CONF} -name "*.rules" -exec /usr/bin/rename.ul .rules .x {} \; (code=exited, status=0/SUCCESS)
  Process: 640 ExecStartPost=/bin/sleep 120 (code=exited, status=0/SUCCESS)
  Process: 1322 ExecStartPost=/bin/bash -c /usr/bin/find ${OPENHAB_CONF} -name "*.x" -exec /usr/bin/rename.ul .x .rules {} \; (code=exited, status=0/SUCCESS)
 Main PID: 638 (java)
    Tasks: 91 (limit: 4915)
   CGroup: /system.slice/openhab2.service
           └─638 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/

Jul 31 20:59:30 openhab systemd[1]: Starting openHAB2 instance, reachable at http://openhab:8080...
Jul 31 21:01:43 openhab systemd[1]: Started openHAB2 instance, reachable at http://openhab:8080.
[21:01:52] root@openhab:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 24.8M 89.4K  416K       4 /opt/zram/zram2
/dev/zram1 lzo-rle       500M 16.4M  7.1K   84K       4 /opt/zram/zram1
/dev/zram0 lzo-rle       600M    4K   87B   12K       4 [SWAP]
[21:04:04] root@openhab:/home/openhabian# systemctl status zram-config
● zram-config.service - zram-config
   Loaded: loaded (/etc/systemd/system/zram-config.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Fri 2020-07-31 21:04:07 CEST; 4s ago
  Process: 239 ExecStartPre=/bin/rm -f /usr/local/share/zram-config/zram-device-list /usr/local/share/zram-config/zram-device-list.rev (code=exited, status=0/SUCCESS)
  Process: 257 ExecStart=/usr/local/bin/zram-config start (code=exited, status=0/SUCCESS)
  Process: 1486 ExecStop=/usr/local/bin/zram-config stop (code=exited, status=0/SUCCESS)
 Main PID: 257 (code=exited, status=0/SUCCESS)

Jul 31 21:04:07 openhab zram-config[1486]: ++ tr -dc 0-9
Jul 31 21:04:07 openhab zram-config[1486]: + DEV_NUM=0
Jul 31 21:04:07 openhab zram-config[1486]: + swapoff /dev/zram0
Jul 31 21:04:07 openhab zram-config[1486]: + echo 0
Jul 31 21:04:07 openhab zram-config[1486]: + /sbin/zramctl -r /dev/zram0
Jul 31 21:04:07 openhab zram-config[1486]: + echo '/dev/zram0 removed'
Jul 31 21:04:07 openhab zram-config[1486]: + read -r line
Jul 31 21:04:07 openhab zram-config[1486]: + rm -fv /usr/local/share/zram-config/zram-device-list.rev /usr/local/share/zram-config/zram-device-list
Jul 31 21:04:07 openhab systemd[1]: zram-config.service: Succeeded.
Jul 31 21:04:07 openhab systemd[1]: Stopped zram-config.
[21:04:11] root@openhab:/home/openhabian# zramctl
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram2 lzo-rle       500M 25.6M 386.6K  836K       4

is this last output okay?
should i stop the zram-config service before restoring my backup (via openhab-cli)?
or should i restore my files manually?

more or less, the last device should be gone as well

no, but it’ll be stopped anyway when you stop oh2.

:confused:

just set up a new system (openHABian 1.5) and disabled zram, data is restored properly.
i think i’ll have to run my system without zram for the moment, this is really not very productive (switching stable/testing on same device).
guess i really have to get anoter pi4…

It does not do harm. Better run WITH ZRAM else you easily end up with problems due to wearout.

for now i’m back on USB/SSD - i know it’s no recommended but for me atm it’s the best/stable way. i’ll report back once i have a testPi!
in the meantime thank you very much for your effort!

Na dankeschön. Die Mühen werde ich mir beim nächsten Mal sparen.

Ich verstehe weder warum wir uns jetzt auf Deutsch austauschen noch warum ich jetzt den schwarzen Peter zugeschoben bekomme.
Ich bin deine Anweisungen 1:1 durchgegangen (sofern nicht missverstanden), aber offensichtlich konnte das Problem nicht gelöst werden. Ich habe versucht alle benötigten Infos zu posten und habe mich hoffentlich auch nicht im Ton vergriffen.
Es ist für den Rest der Familie schwer halt zu verstehen, warum in den letzten Wochen die meiste Zeit irgendwas nicht funktioniert hat (Bewässerung, Beschattung, Torsteuerung), besonders wenn es voher über Jahre stabil war. Ich führe das absolut nicht auf openHABian, ZRAM oder sonstwas zurück, sondern ganz einfach auf die Tatsache, dass es mit nur einem Raspberry mühsam ist zwischen einem nicht stabilen Test-System und einem stabilen System zu wechseln.
Letztendlich habe ich doch nur gesagt, dass ich das Projekt mit ZRAM erstmal auf Eis lege, bis ich ein weiteres Gerät zum Testen habe.

weil die Feinheiten sonst auf der Strecke bleiben

nein das ist nicht offensichtlich. ZRAM funktioniert doch? Und eine Neuinstallation inkl. der neuesten Änderungen hast du noch gar nicht probiert (geht auch nicht weil die ja noch nicht im repo sind) bzw. nur irgendwie händisch auf einem irgendwie vermackelten “Alpha”-System, wo ich nicht weiß was da sonst noch alles an Differenzen zum openHABian-Image vorliegt und somit nicht sicher sein kann ob openHABian am eventuellen Nicht-Funktionieren einen Anteil haben kann.
Mein Interesse bestand darin, etwaige Fehler in openHABian zu finden. Und dafür habe ich mir etliche Stunden um die Ohren gehauen, die meine Familie mich nicht zu sehen bekommen hat.
Da will man natürlich nicht hören “ich hab zurückgebaut weil es nicht funktioniert”, zumal das ja so nicht stimmt, jedenfalls was openHABian/ZRAM angeht.

hmm, ok…

Das ist wohl ein Missverständnis. Mit “Alpha” hab ich mich immer auf das letzte openHABian (1.6 alpha) bezogen, wo ich außer dem hier beschriebenen absolut nichts gemacht habe.
Was mit den “letzten Änderungen” gemeint ist versteh ich nicht ganz, das mit dem override.conf hatte ich noch versucht, leider immer noch ohne erfolgreiches restoreonstart.
Was mir jetzt noch fehlen würde wäre mit der override.conf wie von dir beschrieben und die files manuell einspielen. Dazu komme ich aber zeitlich grad nicht mehr.

Und dafür bin ich auch sehr dankbar, wie auch für den Einsatz aller Beteiligten beim gesamten openHABian Projekt

Nochmal: ich habe VORERST zurückgebaut, weil ich mit MEINEM aktuellen Stand (heißt, ein TestPi fehlt) zurzeit nicht weiterkomme, was genau nicht geht ist mir trotz dem detaillierten Austausch immer noch nicht klar. Laut deiner Aussage sollte ZRAM ja laufen, andererseits werden die items einfach nicht wieder hergestellt. Sobald ich ZRAM deaktiviert habe, liefs auf meinem stable System wieder.
Wie gesagt, ich würde liebend gerne weitermachen sobald ich einen zweiten raspi hierhabe.

Schönes Wochenende

fyi another Mapdb: no restore at startup for item status
With no ZRAM in use as stated right in the beginning

i have found that thread several times, seems “over there” they couldn’t solve the (same or not not) problem either… also:

i ordered another raspberry and will repeat last steps from here with some test items and without openhab-cli backup.