New folder structure


( ) #41

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

https://community.openhab.org/t/openhabian-hassle-free-rpi-image/13379/285?u=thomdietrich

(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
    /root/openhab/apt-repo

  • 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
/var/log/syslog

The paths of KARAF_BASE und KARAF_ETC are wrong. Change the file
/usr/share/openhab2/runtime/bin/oh2_dir_layout
as follows (backup the old before):

#!/bin/sh

# 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_RUNTIME="${OPENHAB_HOME}/runtime"
export OPENHAB_USERDATA="/var/lib/openhab2"
export OPENHAB_LOGDIR="/var/log/openhab2"

export KARAF_HOME="${OPENHAB_RUNTIME}"
export KARAF_DATA="${OPENHAB_USERDATA}"
export KARAF_BASE="${OPENHAB_USERDATA}"
export KARAF_ETC="${OPENHAB_USERDATA}/etc"
  • in file
    /usr/lib/systemd/system/openhab2.service
    replace
    ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop
    with
    ExecStop=/usr/share/openhab2/runtime/bin/stop

  • add optinal Java command line parameter in file
    /etc/defaults/openhab2
    for example
    EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0"
    (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
    /var/log/syslog

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

  • 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
    /usr/share/openhab2/addons

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.

Greenoid


(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.

makeHAB


(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 start.sh 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! http://docs.openhab.org/installation/linux.html#backup-and-restore


(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/branding.properties 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: http://docs.openhab.org -> 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.

[URL=http://www.imagebam.com/image/fecb7f515996510][/URL]

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.

edit:
maybe found the problem.
All installed bindings, extensions and UIs are lost.
Nice…


(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 https://github.com/openhab/openhab-distro/issues/331 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=http://www.imagebam.com/image/642275516021828][/URL] [URL=http://www.imagebam.com/image/538691516021848][/URL]