[SOLVED] Snapshot Release installation - cannot run openhab from the command line

I want to install openhab from Snapshot Release (With Stable Release I can start openhab2 as a service, or from the command line). I followed the instructions in here. Specifically I did the following steps:

sudo apt-get purge openhab2
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
sudo apt-get install apt-transport-https
echo 'deb https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update
sudo apt-get install openhab2

After setting to Snapshot Release I can start the openhab2 as a service with “service openhab2 status”
but I cannot start it from the command line. I’m getting the following error

Launching the openHAB runtime...
mkdir: cannot create directory ‘/usr/share/openhab2/userdata/tmp’: No such file or directory
KARAF_BASE is not valid: /usr/share/openhab2/userdata

Does anyone know how to fix the error message “KARAF_BASE is not valid”
and run openhab from the command line?


This link solved my problem.

export OPENHAB_HOME=/usr/share/openhab2
export OPENHAB_CONF=/etc/openhab2
export OPENHAB_RUNTIME=/usr/share/openhab2/runtime
export OPENHAB_USERDATA=/var/lib/openhab2
export OPENHAB_LOGDIR=/var/log/openhab2

You running it as the correct user (uid)?

If you just want to debug something you could do that from the karaf console:
Start OH2 as service, like you do normally then ssh to the console like this (password should be “habopen”) :

ssh openhab@localhost -p 8101

Then you can debug a specific binding with this command:

log:set DEBUG org.openhab.binding.zwave

No you can read the debug in /var/log/openhab2/openhab2.log. You can also write “log:tail” and the debug will come in the console itself.

Edit: ah, you solved it :slight_smile:

Thanks anyways :+1: