New folder structure

( ) #41

Everyone, I’ve posted a more complete guide over here:

(Frerk Meyer) #42

#Solved openHAB2 RPi Debian package service startup problems

I compiled openhab2-distro after the big directory movement, installed the resulting debian package on my Rpi2 and it took me some tuning until it worked. Here is what I had to do:

  • copy the apt-repo directory to the Raspi from
    openhab2-master/git/openhab-distro/distributions/openhab-offline/target/apt-repo to

  • add it to repositories in file /etc/apt/sources.list.d/openhab.list
    deb file:///root/openhab/apt-repo /

-install openhab2-offline via
apt-get install openhab2-offline

Now it should start as a service but gives errors. I tried

service openhab2 start

and looked into the errors in

The paths of KARAF_BASE und KARAF_ETC are wrong. Change the file
as follows (backup the old before):


# DIRNAME is the directory of karaf, setenv, etc.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH

export OPENHAB_HOME=`cd "$DIRNAME/../.."; pwd`
export OPENHAB_CONF="/etc/openhab2"
export OPENHAB_USERDATA="/var/lib/openhab2"
export OPENHAB_LOGDIR="/var/log/openhab2"

  • in file

  • add optinal Java command line parameter in file
    for example
    (some udev rules have to be written but this is another topic)

  • test the start as a service
    service openhab2 start
    service openhab2 status

  • iif the service is stopping or dead after some time, look in

  • if everything works you should get log output under
    /var/log/openhab2/openhab.log and

  • try the web gui on port 8080 or 8443

  • test if stopping the sevrice works
    service openhab2 stop
    service openhab2 status (should be stopped without errors)

  • enable the service to start at boot time via
    systemctl enable openhab2.service

  • now you are able to add addons by copying them into the directory

I myself am new to openHAB 2, but my my first LaCrosse sensor data is coming in with the prototype binding and I’ll see what I accomplish next.
It could be that there are more paths to correct, but these are enough to get the runtime working again.

And perhaps @theoweiss is able to incorporate the changes into the Debian package creation assembly in openhab-distro itself.

I hope this helps.


(Ben Clark) #43

Hi @greenoid, thanks for the effort, but sorry to say the changes you mention were suggested a couple of days ago above. And an updated debian package has already been published, it should not be necessary to do this anymore.

I would however encourage anyone using these new packages to report any issues, so that we can narrow down any changes that need to be made. And anyone using older packages to delay updating for only a couple days or so.

(Jim) #44

For anyone using the makeHAB script for the latest online bundle, the script has been upgraded and tested. Feel free to pull it.


(rud) #45

@ThomDietrich @Benjy No error-message anymore and connected to dashboard. :clap:
I’m ready for take off. :airplane:

Great job. :+1:
Thanks everybody!

(Frerk Meyer) #46

I used the openhab2-offline package from openhab-distro after making a git pull yesterday 12:00h. And the path problem was not fixed.

( ) #47

…but it actually is. :confused: Have a look:

(dries_dokter) #48

Well that’s embarrassing, you are totally right…
I assumed that the was indeed updated using makeHAB (as it makes a point of removing *.bat) but it uses unzip -n (no overwrite)… My bad :frowning:

(Jim) #49

The script has been updated to address the startup script problem. Feel free to pull/update.

(MikeH) #50

I switched over from OpenHAB1 to OpenHAB2 3 or 4 weeks ago. I installed it by the apt-get method using the snapshot release (Online version) on to a raspberry pi. I have not done an apt-get update and upgrade yet. I want to make sure I do it right with the new folder structure changes. Can someone give me a step by step instructions to do this without losing anything? Thanks!

( ) #51

@MikeH: If you did not make direct changes to files beneath /usr/share/openhab2 you should be able to simply upgrade.
Still something could go wrong. Be sure to make a backup beforehand!

(MikeH) #52

No, I made no changes in that directory. Thanks for the help!

(Frerk Meyer) #53

Now installing opnehab2-offline works

I don’t know why my git didn’t see the change but today i tried again, compiled a Snapshot of openhab2-offline and got it installed and started without problems from a local repository.

BasicUI and ClassicUI show suddenly things?
(Simon) #54

Let’s say I followed these instructions to emergency-repair my broken installation. What would be your recommendation how to update now.

(SiHui) #55

There is one more problem:

$HAB/userdata/etc/ doesn’t get overwritten either, so every time you update the update works, but it shows you the old version number … was quite confusing this morning when I want to check the installed version :slight_smile:

(Stefanseiner) #56

I just updated my OH2 following this instructions: -> openHAB 2 on Linux
and using the offline package of OH2 alpha snapshot.

Seems like the update went well I’m not familiar with Linux but there were no error messages while update process was running).

But now OH “lost” Habmin and Habpanel.


What’s going wrong - or better, how to fix it?

I’m running openhabian on a Pi3 and this was my first update / upgrade ever to be able to use custom widgets on Habpanel.

maybe found the problem.
All installed bindings, extensions and UIs are lost.

(Kai Kreuzer) #57

@Marijn_Oudijk There should never be a need to change the karaf file itself (this is true before and after the folder structure change). This is what EXTRA_JAVA_OPTS is meant for - if this does not work as expected, you should investigate why this is.

(Kai Kreuzer) #58

Good point @sihui! Will have to think about another mechanism to supply the branding - I have created for it.

(Martin) #59

Please do not forget the Non- Linux Users and think about a bat script running under Windows.

(Stefanseiner) #60

and please do not forget the non-pro users who are screwed if an update goes this wrong.

just lost all my configurations too
[URL=][/URL] [URL=][/URL]