New folder structure

Since today’s snapshot build #579, you will notice that files have been moved around (see details here), so you might have some hick-ups doing upgrades from previous snapshots (the apt package most likely does not yet work for an apt upgrade, sorry for that).

The good news is: The new folder layout should solve many issues in future regarding the upgrade process. All configuration that is stored in OSGi ConfigAdmin (e.g. settings that are done through Paper UI) are not lost anymore as they are now within the userdata folder, which does not get overwritten. Same is true for the logging configuration, which is not lost anymore.

Another folder that moved out of “runtime” is “sounds” - this can now be found in conf/sounds instead, see here.

As a result, the content of the runtime folder should be completely uninteresting for any user - there should be no need to ever touch any file; if you do not agree, please let me know!
This is a vital part of the concept: Having the runtime folder completely read-only (e.g. mountable on a read-only file system as well) and being able to fully replace it by updated versions without having to care for any user changes.

Regards,
Kai

5 Likes

Great improvement! Saves us all some hassle.

What of Habpanel settings? Just wrote a question regarding this in another thread.

Help - after upgrading, sudo systemctl status openhab2.service gives:
Any suggestions?

● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: failed (Result: start-limit) since Fri 2016-11-11 17:47:34 NZDT; 2s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 2423 ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop (code=exited, status=203/EXEC)
Process: 2347 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=1/FAILURE)
Main PID: 2347 (code=exited, status=1/FAILURE)

Nov 11 17:47:34 OH32B systemd[1]: Unit openhab2.service entered failed state.
Nov 11 17:47:34 OH32B systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 11 17:47:34 OH32B systemd[1]: Stopping openHAB 2 - empowering the smart home…
Nov 11 17:47:34 OH32B systemd[1]: Starting openHAB 2 - empowering the smart home…
Nov 11 17:47:34 OH32B systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Nov 11 17:47:34 OH32B systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Nov 11 17:47:34 OH32B systemd[1]: Unit openhab2.service entered failed state.

Should be kept as well now!

:+1:

Warning (apt)

I want to emphasize, that apt upgrade is currently in fact breaking your openHAB system.
This is a short time error which will probably be solved soon.
Please stay clear from upgrading for a couple of days.

In all cases this is only a temporary problem and you will be able to apt upgrade to the soon to be released working release.

Updates to follow.

And what to do if you have already updated and openHAB2 no longer run?

If you can wait: just wait for the next upgrade.
If you need your system now: A fix is underway, check: https://github.com/openhab/openhab-distro/pull/318#issuecomment-259861176

Anyone having problems Can you try running the following lines and let me know if this works. I would still recommend that you do not upgrade until the install packages have been fixed.

mv /usr/share/openhab2/runtime/karaf/etc/* /var/lib/openhab2/etc/
sudo sed -i -e 's|/usr/share/openhab2/runtime/karaf/bin/|/usr/share/openhab2/runtime/bin/|g' /etc/init.d/openhab2 /usr/lib/systemd/system/openhab2.service
sudo sed -i -e 's|OPENHAB_USERDATA="${OPENHAB_HOME}/userdata"|OPENHAB_USERDATA="/var/lib/openhab2"|g' /usr/share/openhab2/runtime/bin/oh2_dir_layout
sudo sed -i -e 's|OPENHAB_CONF="${OPENHAB_HOME}/conf"|OPENHAB_CONF="/etc/openhab2"|g' /usr/share/openhab2/runtime/bin/oh2_dir_layout
sudo sed -i -e 's|OPENHAB_LOGDIR="${OPENHAB_USERDATA}/logs"|OPENHAB_LOGDIR="/var/log/openhab2"|g' /usr/share/openhab2/runtime/bin/oh2_dir_layout

sudo systemctl daemon-reload
sudo service openhab2 start
5 Likes

I can confirm, appears to have resolved the issue. I’m back online.

My Things are still there, but bindings etc have been lost - which is pretty normal.

I’ll reload them and report back.

Big bunch of errors still thrown in the log though. Do you need a log file?

Thanks Duncan

Just to make sure, yes please. The changes I make above are completely reversed with another apt upgrade, so you can freely apply this without worrying about any special undos.

openhab.xml (763.8 KB)

Here’s the log file.

Can’t SSH into the console now:

And the manual console has moved from: /usr/share/openhab2/runtime/karaf/bin/client

pi@raspberrypi:/ $ ssh -p 8101 openhab@localhost
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
19:1c:f9:07:be:6f:ae:e4:9f:ca:bd:e7:5b:8d:9d:8d.
Please contact your system administrator.
Add correct host key in /home/pi/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/pi/.ssh/known_hosts:1
  remove with: ssh-keygen -f "/home/pi/.ssh/known_hosts" -R [localhost]:8101
RSA host key for [localhost]:8101 has changed and you have requested strict checking.
Host key verification failed.

EDIT:
Found the solution

Ran the following:
ssh-keygen -f “/home/pi/.ssh/known_hosts” -R [localhost]:8101
ssh-keygen -R openhab@localhost

1 Like

Is there any hotfix available to get the system up and running including bindings?
The fix mentioned above helps to start openhab2, but binding (though they are configured) are still not available.

Hi @robin.muellerbady, have you set your parameters in /etc/openhab2/addons/services.cfg?

@Duncan_Pullen, if you clear the logs and perform a sudo service openhab2 restart do these errors persist?

I don’t have any folder like that. Is it mandatory or part of the new folder structure?

Sorry @robin.muellerbady, I mixed up the path, it is /etc/openhab2/services/addons.cfg and should have always been in your installation. You can set a comma separated list of bindings to install on a successful update here.

Ok, thank you. This config file exists and contains all necessary bindings and actions (in my case: sonos, knx, astro + telegram). However, neither the knx nor the sitemaps are working correctly. Is this due to this issue and will be resolved with the upgrade?

Quite honestly, I don’t know. When you say they aren’t working correctly, what’s happening in your logs?

Try also:

cp /usr/share/openhab2/runtime/karaf/etc/* /var/lib/openhab2/etc/

I’ve edited my post as above

Yes, it worked. got me up and running again anyway.

Now all my logs are messed up, and I can’t find org.ops4j.pax.logging.cfg anymore - where did you guy’s put it?