New folder structure

Hi @Benjy, sorry but nothing has changed after running “sudo apt-get update && sudo apt-get upgrade”.

That’s odd, do you get anything in /var/log/openhab2/openhab.log? If not, do you get anything related to openhab in /var/log/daemon.log?

I notice that you were running off of a new install. If you haven’t made any changes to openhab worth backing up, the best way to start anew would be to:

sudo apt-get purge openhab2-offline
sudo apt-get install openhab2-offline

Check those logs again and run a couple of “sudo service openhab2 restart” commands, if you’re still not running I will try and run the same process as you and see if I can debug from there.

Sorry, my mistake. Because I waited for the error message in openHABian-welcome-screen to desapear I didn’t tried to connect to dashboard and openhab.

As the openhab.log shows, the dashboard has been started and I can connect to dashboard and ui-interface.

Daemon.log is empty.

Now I did:

sudo apt-get purge openhab2-offline
sudo apt-get install openhab2-offline
sudo service openhab2 restart
sudo shutdown -r now

but in the openHABian-welcome-screen the error

awk: cannot open /usr/share/openhab2/runtime/karaf/etc/branding.properties (No such file or directory)

still appears like shown in the picture a few posts before.
Should I have to be worried about this message or just continue using openhab?

Thanks.

This is probably an openHABian specific error, (@ThomDietrich to confirm?) but nothing to worry about, those messages tell me that you’re setup and ready to go! :slight_smile:

@anfaenger another needed change because of the big folder structure change. You really chose the wrong weekend for your first openHAB experiences :sweat_smile:
I’ve already implemented the needed changes in openHABian. Please execute sudo openhabian-config, then first select “Update” to retrieve these changes, then select “Basic Setup” to apply them to your system.

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

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

#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

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.

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

makeHAB

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

Great job. :+1:
Thanks everybody!

1 Like

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

1 Like

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

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:

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

1 Like

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!

@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

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

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.

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

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: