[SOLVED] [JDBC/MySQL] Gets uninstalled on each OH2.3.0 restart

openhab2
persistence
jdbc
Tags: #<Tag:0x00007f015a2e8260> #<Tag:0x00007f015a2e80f8> #<Tag:0x00007f015a2e7f40>

(Todd Evans) #1

After searching a bit… looking to understand how to stop ‘JDBC Persistence MySQL’ from uninstalling after every restart of the Pi 3 or openhab2 service.
I understand that I have to add it to the config file but having trouble finding the actual file AND the syntax.
‘Linux openHABianPi 4.14.69-v7+ #1141 SMP Mon Sep 10 15:26:29 BST 2018 armv7l GNU/Linux’
Openhab2 version:
openhab2 2.3.0-1 all openhab2
openhab2-addons 2.3.0-1 all openhab2-addons

Thanks
Todd


(Angelos) #2

how big is your /var/log/openhab2/openhab.log file?
how did you deploy openhab2-addons? (using apt or manually?)

how did you install persistence-jdbc-mysql Add-on? (using PaperUI?)

Addons should not be uninstalled after restart.
You shouldn’t have to edit any file.

When you install an addon from PaperUI, the following config file is updated automatically for you and persists the changes: $OPENHAB_USERDATA/config/org/openhab/addons.config.
You should NOT modify this file. It is managed by the OH2 system.

Users can modify manually the source config file in $OPENHAB_CONF/services/addons.cfg
BUT… if you start using this file, you need to manage your Add-ons ONLY from there. Any changes that you do via the PaperUI (un/install Addons) will not persist a service restart.

Check if the persistence = line is un-commented and empty. This would explain why the addon is getting uninstalled on restart (because the addons.cfg tells the OH2 system to install nothing with regards to persistence addons).

Best way: comment out everything in addons.cfg and use PaperUI to manage your Add-ons.


(Vincent Regaud) #3

Not completely accurate.

If you modify the bindings section of the addons.cfg file then you will not be able to persist any bindings added via the paperUI. But any other addons (action, UIs, persistence) will still work.
The addons.cfg works by addon type.


(Angelos) #4

very accurate :slight_smile: (but not very detailed I have to admit)
I didn’t specify the type of addon so the logic applies to each addon type :stuck_out_tongue:


(Todd Evans) #5

Welp… Thanks.
That was it.:clap:
I had this one line uncommented so I commented it, restarted and… YAY!
/etc/openhab2/services/addons.cfg.
#persistence = mysql
Weird… I don’t recall doing that initially… but, who knows what I do sometimes :slight_smile:
Thanks, Fellers!
Todd


(Angelos) #6

addons.cfg (since you marked your post as the solution, edit it so others don’t make mistakes :slight_smile:)


(Todd Evans) #7

My Apologies:
This was a openHABianpi - Raspberry Pi 3 install.
Using PaperUI, I installed the persistence-jdbc-mysql Add-on.
Somewhere along the line I had this line in this file:
/etc/openhab2/services/addons.cfg
persistence = mysql
I changed it to this:
#persistence = mysql
restarted the Pi and THIS TIME… the persistence-jdbc-mysql add-on did not delete.
Thanks again!!