openhab / openhab-linuxpkg

Repo for Linux packages
Eclipse Public License 2.0
18 stars 33 forks source link

Virgin install of new package does not proceed #19

Closed watou closed 7 years ago

watou commented 7 years ago

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.

pi@habpi2:~ $ echo 'deb http://dl.bintray.com/openhab/apt-repo2 unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
deb http://dl.bintray.com/openhab/apt-repo2 unstable main
pi@habpi2:~ $ wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
OK
pi@habpi2:~ $ sudo apt-get update
Ign http://dl.bintray.com unstable InRelease
Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]  
Hit http://archive.raspberrypi.org jessie InRelease                                              
Get:2 http://dl.bintray.com unstable Release.gpg [821 B]                                         
Hit http://ppa.launchpad.net trusty InRelease                            
Get:3 http://dl.bintray.com unstable Release [6,054 B]                   
Hit http://archive.raspberrypi.org jessie/main armhf Packages                          
Get:4 http://mirrordirector.raspbian.org jessie/main armhf Packages [8,981 kB]                                            
Hit http://archive.raspberrypi.org jessie/ui armhf Packages                                                               
Hit http://ppa.launchpad.net trusty/main Sources                                                                                                     
Hit http://ppa.launchpad.net trusty/main armhf Packages                                                                            
Get:5 http://dl.bintray.com unstable/main armhf Packages [2,157 B]                                                                                   
Hit http://ppa.launchpad.net trusty/main Translation-en                                                                                 
Ign http://dl.bintray.com unstable/main Translation-en_GB                                                                                            
Ign http://dl.bintray.com unstable/main Translation-en                                                                                               
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB                                                                                     
Ign http://archive.raspberrypi.org jessie/main Translation-en                                                                                        
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB                                                                                       
Ign http://archive.raspberrypi.org jessie/ui Translation-en                                                                                          
Get:6 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [37.5 kB]                                                                     
Get:7 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [70.3 kB]                                                                    
Get:8 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]                                                                         
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB                                                                              
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en                                                                                 
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB                                                                                 
Ign http://mirrordirector.raspbian.org jessie/main Translation-en                                                                                    
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB                                                                             
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en                                                                                
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB                                                                                  
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en                                                                                     
Fetched 9,114 kB in 59s (152 kB/s)                                                                                                                   
Reading package lists... Done
pi@habpi2:~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... The following packages were automatically installed and are no longer required:
  libxi6 libxrender1 libxtst6
Use 'apt-get autoremove' to remove them.
Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
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 52.1 MB of archives.
After this operation, 58.5 MB of additional disk space will be used.
Get:1 http://dl.bintray.com/openhab/apt-repo2/ unstable/main openhab2 all 2.0.0~20170110001819-1 [52.1 MB]
Fetched 52.1 MB in 5min 47s (150 kB/s)                                                                                                               
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
pi@habpi2:~ $ cd /var/log/openhab2
pi@habpi2:/var/log/openhab2 $ ls -al
total 8
drwxr-xr-x 2 openhab openhab 4096 Jan 10 08:23 .
drwxr-xr-x 7 root    root    4096 Jan 10 06:25 ..
-rw-r--r-- 1 openhab openhab    0 Jan 10 08:23 events.log
-rw-r--r-- 1 openhab openhab    0 Jan 10 08:23 openhab.log
-rwxr-xr-x 1 openhab openhab    0 Jan  9 23:18 Readme.txt
pi@habpi2:/var/log/openhab2 $ ssh openhab@localhost -p 8101
ssh: connect to host localhost port 8101: Connection refused
pi@habpi2:/var/log/openhab2 $ sudo /bin/systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Tue 2017-01-10 08:23:26 UTC; 1min 22s ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
 Main PID: 7980 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─7980 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           └─8131 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dope...

Jan 10 08:23:26 habpi2 systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 10 08:23:26 habpi2 start.sh[7980]: Launching the openHAB runtime...
pi@habpi2:/var/log/openhab2 $ date
Tue 10 Jan 08:44:55 UTC 2017
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:41797         :::*                    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 $ cat openhab.log 
BClark09 commented 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?

watou commented 7 years ago

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.

BClark09 commented 7 years ago

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?

ThomDietrich commented 7 years ago

Never happened to me either. not even another/older java version should have that effect...

watou commented 7 years ago

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?

BClark09 commented 7 years ago

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.

watou commented 7 years ago

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.