Java Runtime Environment: 1.8.0_162 (I guess Oracle?)
openHAB version: 2.4.0
Issue of the topic:
There seems to be two places where the userdata directory is defined: #1. in /etc/init.d/openhab2 (OPENHAB_USERDATA=/var/lib/openhab2) #2. in /usr/share/openhab2/runtime/bin/oh2_dir_layout (OPENHAB_USERDATA=${OPENHAB_HOME}/userdata
This (#2) gives /usr/share/openhab2/userdata.
When I start /usr/share/openhab2/runtime/bin/client, I get an error:
KARAF_BASE is not valid: /usr/share/openhab2/userdata.
I had this error in Openhab 2.3.0. And because I didn’t want to solve it in an old version, I upgraded (apt-get upgrade) to 2.4.0.
The first hours I did not have the problem, but a day later a had this error when I started the client.
The current Raspbian Image should use systemd instead of init. Myabe there is something mixed up in your installation.
Please don’t start openHAB directly but only as a service.
Using init it would be
sudo service openhab2 start
or
sudo /etc/init.d/openhab2 start
Using systemd it would be
sudo systemctl start openhab2.service
Please consider to backup your configuration and start from scratch - i.e. install a new raspbian image, install openHAB2… or, even simpler, use openHABian to setup a new system (openHABian will install Raspbian first, then setup the whole system to use openHAB2, there is a config-script to do all the stuff that is needed…)
Thank you for the answers. There were some other strange things that could be related to a bad SD card. I ordered a new SD card and will do a fresh install with the latest Raspbian and OpenHAB. I am not (yet) going to use OpenHABian, that would be a too big change for me at this moment.
A backup should not be needed as everything is in github and sourceforge. And the old SD card is the second backup.