Closed watou closed 7 years ago
I've just tried a new installation on an RPi 3 Raspbian Jessie which is working as normal. I have a spare RPi 2 at home that I can test later but I'm unaware of any potential differences when it gets to the java process. What is the version of Java you have?
What is the version of Java you have?
pi@habpi2:~ $ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)
pi@habpi2:~ $ uname -a
Linux habpi2 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux
After a stop and start of openhab2.service, there was no observable difference. There is a java process running when started, but it's not logging or listening.
Many thanks for your investigation.
Hmm... We're running the same configurations:
pi@rpihab:~ $ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)
pi@rpihab:~ $ uname -a
Linux rpihab 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux
No problem, I'll get back to you as soon as I am able to test the Pi 2. Meanwhile, is there anything extra printed out in /var/log/daemon.log?
Never happened to me either. not even another/older java version should have that effect...
Purging, installing, restarting had no effect:
pi@habpi2:/var/log/openhab2 $ sudo /bin/systemctl stop openhab2.service
pi@habpi2:/var/log/openhab2 $ sudo apt-get purge openhab2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libxi6 libxrender1 libxtst6
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
openhab2*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 58.5 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 32791 files and directories currently installed.)
Removing openhab2 (2.0.0~20170110001819-1) ...
Purging configuration files for openhab2 (2.0.0~20170110001819-1) ...
Processing triggers for systemd (215-17+deb8u5) ...
pi@habpi2:~ $ sudo apt-get install openhab2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libxi6 libxrender1 libxtst6
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
openhab2
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/52.1 MB of archives.
After this operation, 58.5 MB of additional disk space will be used.
Selecting previously unselected package openhab2.
(Reading database ... 31674 files and directories currently installed.)
Preparing to unpack .../openhab2_2.0.0~20170110001819-1_all.deb ...
Unpacking openhab2 (2.0.0~20170110001819-1) ...
Processing triggers for systemd (215-17+deb8u5) ...
Setting up openhab2 (2.0.0~20170110001819-1) ...
### NOT starting on installation, please execute the following statements to configure openHAB to start automatically using systemd
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable openhab2.service
### You can start openhab2 by executing
sudo /bin/systemctl start openhab2.service
pi@habpi2:~ $ sudo /bin/systemctl daemon-reload
pi@habpi2:~ $ sudo /bin/systemctl enable openhab2.service
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
Executing /usr/sbin/update-rc.d openhab2 enable
Created symlink from /etc/systemd/system/multi-user.target.wants/openhab2.service to /usr/lib/systemd/system/openhab2.service.
pi@habpi2:~ $ sudo /bin/systemctl start openhab2.service
...wait a few minutes...
pi@habpi2:/var/log/openhab2 $ ls -al
total 8
drwxr-xr-x 2 openhab openhab 4096 Jan 10 15:10 .
drwxr-xr-x 7 root root 4096 Jan 10 15:08 ..
-rw-r--r-- 1 openhab openhab 0 Jan 10 15:10 events.log
-rw-r--r-- 1 openhab openhab 0 Jan 10 15:09 openhab.log
-rwxr-xr-x 1 openhab openhab 0 Jan 9 23:18 Readme.txt
pi@habpi2:/var/log/openhab2 $ netstat -an | grep LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 127.0.0.1:44458 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
unix 2 [ ACC ] STREAM LISTENING 4914 /run/systemd/private
unix 2 [ ACC ] SEQPACKET LISTENING 4936 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 4940 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 5773 /var/run/dhcpcd.sock
unix 2 [ ACC ] STREAM LISTENING 5775 /var/run/dhcpcd.unpriv.sock
unix 2 [ ACC ] STREAM LISTENING 8649 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 8652 /var/run/dbus/system_bus_socket
pi@habpi2:/var/log/openhab2 $ ps -ef | grep java
openhab 10088 9937 11 15:09 ? 00:00:13 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/openhab2/config -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/ext:/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/share/openhab2/runtime/lib/ext -Dkaraf.instances=/usr/share/openhab2/runtime/instances -Dkaraf.home=/usr/share/openhab2/runtime -Dkaraf.base=/var/lib/openhab2 -Dkaraf.data=/var/lib/openhab2 -Dkaraf.etc=/var/lib/openhab2/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab2/tmp -Djava.util.logging.config.file=/var/lib/openhab2/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.main-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main
pi 10163 698 0 15:11 pts/0 00:00:00 grep --color=auto java
Is a reboot required?
Hi @watou I formatted an sd card with the latest Raspbian image, loaded it on a rpi2 upgraded the default software. I then installed java followed by the latest openhab2 package. It's up and working without any issue.
pi@raspberrypi:~ $ netstat -an | grep LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 127.0.0.1:8101 :::* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 127.0.0.1:33850 :::* LISTEN
tcp6 0 0 :::8443 :::* LISTEN
unix 2 [ ACC ] STREAM LISTENING 6942 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 6945 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 6954 /var/run/dhcpcd.sock
unix 2 [ ACC ] STREAM LISTENING 6956 /var/run/dhcpcd.unpriv.sock
unix 2 [ ACC ] STREAM LISTENING 6239 /run/systemd/private
unix 2 [ ACC ] SEQPACKET LISTENING 6261 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 6265 /run/systemd/journal/stdout
No reboot was required. Went from new image to running openhab2 in just a few commands I'm afraid to say.
I'm very grateful you went to that effort. I thought I went through the same steps, but I'm glad it appears to be my problem and not experienced by others. If I find the root cause, I will report it here.
The following steps to install and start the new distro on latest Raspbian update (RPi2 B) get as far as starting but never listens on port 8080, and nothing written to newly created
/var/log/openhab2/openhab.log
after 20+ minutes.