Installation went wrong

Tags: #<Tag:0x00007fc8fcdeea28>

Hi,

after installing and having run the installation previously , I somehow wrecked it, adnd did it again, and again unistalled because somehow I mixed up manual and express installations. Do you still understand? Me neither.

Thing is… I have Domoticz also running on the same Rpi, and it may not be harmed as it is keeping up with my energy meter and usage,
So starting over with a fresh Raspbian (jessie, full) is out of the question. For the same reason I can not use Domoticz for home automation. (or you may have a solution for Domoticz to not flood the MTT server with energy data when turning on MQTT).

So: something is seriously wrong with the openHab installation. But I want it back because it recognized the Orvibo smart plugs.
Please help.


### You can start openhab2 by executing
 sudo /bin/systemctl start openhab2.service
Bezig met afhandelen van triggers voor systemd (232-25+deb9u4) ...
pi@raspberrypi:~ $ sudo /bin/systemctl start openhab2.service
pi@raspberrypi:~ $ sudo /bin/systemctl daemon-reload
pi@raspberrypi:~ $ sudo /bin/systemctl enable openhab2.service
Synchronizing state of openhab2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable openhab2
pi@raspberrypi:~ $ sudo systemctl status openhab2.service
● openhab2.service - The openHAB 2 Home Automation Bus Solution
   Loaded: loaded (/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2018-11-10 19:29:01 CET; 1min 9s ago
     Docs: http://docs.openhab.org
 Main PID: 11255 (code=exited, status=210/CHROOT)

nov 10 19:29:01 raspberrypi systemd[1]: openhab2.service: Unit entered failed state.
nov 10 19:29:01 raspberrypi systemd[1]: openhab2.service: Failed with result 'exit-code'.
nov 10 19:29:01 raspberrypi systemd[1]: openhab2.service: Service hold-off time over, scheduling restart.
nov 10 19:29:01 raspberrypi systemd[1]: Stopped The openHAB 2 Home Automation Bus Solution.
nov 10 19:29:01 raspberrypi systemd[1]: openhab2.service: Start request repeated too quickly.
nov 10 19:29:01 raspberrypi systemd[1]: Failed to start The openHAB 2 Home Automation Bus Solution.
nov 10 19:29:01 raspberrypi systemd[1]: openhab2.service: Unit entered failed state.
nov 10 19:29:01 raspberrypi systemd[1]: openhab2.service: Failed with result 'exit-code'.

anything useful in /var/log/openhab2/openhab.log ?

did you try to clear the cache?

what is your java -version ?

/var/log/openhab2/ only has an empty readme.txt.
fine, clear cache… how? (reboot twice)
java helper library 1.8.3 dfs 1
java helper for web 3.1.1-2
javascript common 11
etc. there are a lot of java packages and versions, specify pls.

what is the output of the command in the Linux shell ? (java -version)

This raises a bunch of alarms.

If you cannot afford a little down time on the Domoticz then nothing else should be installed in this RPi. And your primary focus right now should be to make it so you have a good backup and restore plan for Domoticz because it will fail at some point.

Then look to install OH on some other machine or install it on the same machine knowing you can quickly restore Domoticz if the bed arises.

It is frankly not worth your time to try and fight OH on this same machine at this point. If keeping Domoticz running is this critical then you need to focus on making it rock solid with backup and restore that takes next to no time. And then nothing else should run on this machine.

Nothing that is so critical that you can’t afford a few hours of down time should run on the same machine as other stuff. The risk of down time is too high.

a few hours downtime is not critical, it’s just that I do not want to do the calculations. The energy meter itself is standalone and transmits to the company anyway. In fact I just installed monit because Domoticz has been down for 2 days
I realise that tinkering with the Rpi and home automation will disrupt some running services. But it should be able to run them all without much trouble. I do not want to give up my other Rpi just to be safe with this one.
Then to be even more safe, I should set it up in a different building to get the maximum out of the redundancy. Even then … with only 1 energy meter sensor, it would be better even to have the data in the cloud somewhere. That should be a priority project.
However I want to have fun in the mean time and have my smart devices taken care of too. OpenHab should be able to handle that.
And that gets me back to this issue.

Well, here is the problem. When OH runs into problems like this, the most efficient use of your time and the time of the users on this forum will be to do a fresh install.

There is not enough information provided for us to really help. And even if there were, we are not physically present in front of this device and we can’t root around to try to figure out what the problem is. You didn’t even tell us how you installed OH.

You can look through the syslogs or use (journalctl)[https://www.linode.com/docs/quick-answers/linux/how-to-use-journalctl/] to see if there is something more useful logged to the syslog that tells you what might be wrong. What ever it is, it is going to be something fundamental like it can’t find java or it doesn’t have permission to read or write to something critical.

I did use a fresh install , like on the Package Repository Installation page, then uninstall after the crash, then again fresh.again uninstall and again install. Somehow the uninstall did not completely work, I think.

ov 15 04:49:20 raspberrypi dhcpcd[378]: eth0: carrier acquired
nov 15 04:49:20 raspberrypi systemd[528]: openhab2.service: Failed at step CHROOT spawning /opt/openhab2/start.sh: No such file or directory
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Main process exited, code=exited, status=210/CHROOT
nov 15 04:49:20 raspberrypi systemd[533]: openhab2.service: Failed at step CHROOT spawning /bin/kill: No such file or directory
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Control process exited, code=exited status=210
nov 15 04:49:20 raspberrypi dhcpcd[378]: eth0: IAID eb:0f:a0:4a
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Unit entered failed state.
nov 15 04:49:20 raspberrypi dhcpcd[378]: eth0: adding address fe80::af0a:f6b3:56e:93c5
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Failed with result 'exit-code'.
nov 15 04:49:20 raspberrypi sshd[532]: Server listening on 0.0.0.0 port 22.
nov 15 04:49:20 raspberrypi sshd[532]: Server listening on :: port 22.
nov 15 04:49:20 raspberrypi systemd[1]: Started OpenBSD Secure Shell server.
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Service hold-off time over, scheduling restart.
nov 15 04:49:20 raspberrypi systemd[1]: Stopped The openHAB 2 Home Automation Bus Solution.
nov 15 04:49:20 raspberrypi systemd[1]: Started The openHAB 2 Home Automation Bus Solution.
nov 15 04:49:20 raspberrypi systemd[536]: openhab2.service: Failed at step CHROOT spawning /opt/openhab2/start.sh: No such file or directory
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Main process exited, code=exited, status=210/CHROOT
nov 15 04:49:20 raspberrypi systemd[538]: openhab2.service: Failed at step CHROOT spawning /bin/kill: No such file or directory
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Control process exited, code=exited status=210
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Unit entered failed state.
nov 15 04:49:20 raspberrypi systemd[1]: openhab2.service: Failed with result 'exit-code'.

java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

that’s very old for OH2. The recommended is >161

can you upgrade your JVM using either Zulu or Oracle?

the whole raspbian is from september. I imagine they use up to date parts…

They do not.The default versions in the default repos are always behind, sometimes embarrassingly so.

Java 1.8.0_65 will not work.

As documented in the Prerequisites section of the installation documentation, the latest 32-bit Zulu version of Java 1.8 is the recommended Java to run OH on a RPi.

ok. no openhab for me then, all java installs refuse to work.

pi:~ $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
Executing: /tmp/apt-key-gpghome.aY3YlQ2CGn/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
gpg: failed to start the dirmngr '/usr/bin/dirmngr': Bestand of map bestaat niet
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.aY3YlQ2CGn/S.dirmngr' failed: Bestand of map bestaat niet
gpg: keyserver receive failed: Geen dirmngr

openjdk completes with failures, oracle I hate (from earlier days)

If you are on an RPi, why even fight this battle?

Look at https://www.openhab.org/docs/installation/openhabian.html which will give you a preconfigured OS with all the prerequisites already installed and configured.

If you don’t want to start from scratch, you can start with a stock raspbian and follow the manual instructions.

because I do not want a preconfigured openhab os. Openhab is not the primary program it should run. It has to run the energy meter and Domoticz, everything else is secundary. I could probably run it on one of the windows pc’s available, but they tend to use about 5 times as much power. (very little for a pc huh) and I want to stop running them 24/7 just because the power gets too expensive here.
So the Rpi should run 24/7 and also manage the iot I am building.
Openhab had the option to become the package to go for, but when it depends on some shit like java which even oracle dumped already, it seems openhab is not for me.

openHABian is just a script or a series of scripts. If you follow the manual steps you can install and configure as much or as little as you want. There is nothing that prevents you from running other programs with openHABian. It just automates all of this installation and configuration stuff.

But if you don’t want to accept the help from all the work people have done to make this easier for you then perhaps openHAB isn’t for you. We like to offer help here.

Oracle may have dumped it but plenty of others have picked it up and continue to use it. And for the record, we do NOT recommend Oracle’s Java to run openHAB. OpenJDK has known problems on RPis that make it unsuitable. We recommend Zulu. I don’t speak your language so I can’t begin to tell you why importing the gpg key failed.

If you are worried about openHAB interfering with your other services, you can run it in a Docker container. Then you don’t have to install anything but Docker and openHAB will be isolated from the other programs you want to run.

root@raspberrypi:/usr/local/src# sudo update-alternatives --config java
Er zijn 3 beschikbare keuzemogelijkheden voor het alternatief java (dat voorziet in /usr/bin/java).

  Keuze        Pad                                                    Prioriteit Status
------------------------------------------------------------
* 0            /usr/lib/jvm/zulu-embedded-8-armhf/bin/java             1082500   automatische modus
  1            /opt/jdk1.8.0/bin/java                                  1         handmatige modus
  2            /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java   318       handmatige modus
  3            /usr/lib/jvm/zulu-embedded-8-armhf/bin/java             1082500   handmatige modus

Druk <enter> om de huidige keuze[*] te behouden, of typ een keuzenummer in: 1
update-alternatives: /opt/jdk1.8.0/bin/java wordt gebruikt om in de handmatige modus in /usr/bin/java (java) te voorzien.
root@raspberrypi:/usr/local/src# java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) Client VM (build 25.192-b12, mixed mode)

I appreciate your help. Even if my reasoniing may indicate otherwise.
Docker looks like something between vmware and sandbox. On a rpi that goes too deep for me. I could just run linux on a vmware image if I wanted to go that way,
By the way… I keep images of the Rpi sd-card on the pc. Did restore from september, reinstalled monit and now java. might do a new image before trying openhab install again, So I have a relatively clean system to work with.

If you do start from scratch, I’d start with either openHABian or install a manual instead of openHABian on a stock raspbian minimal.

Like I said, there is nothing special about openHABian. Is just a bunch of scripts that installs OH and optionally other services like Mosquitto, InfluxDB, Amanda and such. But it’s just a bunch of scripts. Once it’s run all you end up with is regular old Raspbian, it off you prefer Ubuntu with some software installed and configured. You can then install and configure any other software you want to run on it too.

But the key is the openHABian scripts are known to work. You should not have to face problems like these and using openHABian doesn’t prevent you from installing anything else you want to.

$ sudo systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor pre
   Active: active (running) since Sat 2018-11-17 11:44:14 CET; 19min ago
     Docs: https://www.openhab.org/docs/
           https://community.openhab.org
 Main PID: 463 (java)
   CGroup: /system.slice/openhab2.service
           └─463 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf

nov 17 11:44:14 raspberrypi systemd[1]: Started openHAB 2 - empowering the smart

pi@raspberrypi:~ $