openHAB 2 + Solaris 11

I’m trying to get openHAB 2 running on Solaris 11 on an i3 3.7GHz with 24GB RAM, but nothing happens other than the initial output to the console:

$ ./start_debug.sh
Launching the openHAB runtime…

openHAB 1.8.3 works with no problems.
I tried the latest openhab-2.0.0-SNAPSHOT.zip, an older openhab-online-2.0.0-SNAPSHOT.zip and openhab-2.0.0.RC1.tar.gz

How can I enable some logging to know what’s going on?

Do you get a openhab> prompt? If so, try:

log:set DEBUG org.eclipse.smarthome

Nope. I only get this print. Nothing else is happening.
top shows that karaf is using 1.46% cpu.

Anything in userdata/logs/openhab.log

I had a somewhat similar experience on a Raspberry Pi 2 Model B running latest Raspbian Jessie Lite and after installing Oracle JDK 8. The runtime started to launch, the Java process was running, some small amount of CPU was being consumed, the VM was listening on debug port 5005, but the process never proceeded to listen on ports 8080 (web) or 8081 (ssh).

The solution had something to do with another attempt at re-installing Oracle JDK (same, latest version). I never nailed down the details.

So make sure you are on latest JDK for Solaris 11, if you have update-alternatives, make sure it’s set to the correct version, and otherwise validate your JDK install.

No. The logs directory isn’t even created.

robert@server:/pool/home/robert/openhab$ ls userdata/
etc tmp
robert@server:/pool/home/robert/openhab$

I have now downloaded and tried both jre-8u121-solaris-x64.tar.gz and jdk-8u121-solaris-x64.tar.gz. No difference :disappointed:

It was and remains a mystery to me why uninstalling and re-installing the JDK on Raspbian Jessie Lite made a difference in whether the server managed to fully start. Please let us know if you are able to get past the issue and what you think made the difference. Is the java process listening on port 5005 for remote debugging? Perhaps that path can shed light.

Doesn’t seem so.

robert@server:/pool/home/robert/openhab/userdata$ telnet localhost 5005
Trying ::1…
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1…
telnet: Unable to connect to remote host: Connection refused

Any ports listening on the box that you don’t recognize, while you’re looking?

netstat -an | grep LISTEN

(been a while since I’ve used Solaris, so hopefully netstat -an works there.)

robert@server:/pool/home/robert/openhab/userdata$ netstat -an | grep LISTEN
127.0.0.1.5999             *.*                  0      0  128000      0 LISTEN
127.0.0.1.4999             *.*                  0      0  128000      0 LISTEN
      *.111                *.*                  0      0  128000      0 LISTEN
      *.111                *.*                  0      0  128000      0 LISTEN
      *.22                 *.*                  0      0  128000      0 LISTEN
      *.22                 *.*                  0      0  128000      0 LISTEN
127.0.0.1.631              *.*                  0      0  128000      0 LISTEN
      *.139                *.*                  0      0  128000      0 LISTEN
      *.445                *.*                  0      0  128000      0 LISTEN
127.0.0.1.3493             *.*                  0      0  128000      0 LISTEN
127.0.0.1.58751            *.*                  0      0  128000      0 LISTEN
127.0.0.1.1008             *.*                  0      0  128000      0 LISTEN
127.0.0.1.25               *.*                  0      0  128000      0 LISTEN
127.0.0.1.587              *.*                  0      0  128000      0 LISTEN
192.168.1.2.18083          *.*                  0      0   65928      0 LISTEN
::1.5999                                *.*                               0      0  128000      0 LISTEN      
      *.111                             *.*                               0      0  128000      0 LISTEN      
      *.22                              *.*                               0      0  128000      0 LISTEN      
::1.631                                 *.*                               0      0  128000      0 LISTEN      
      *.445                             *.*                               0      0  128000      0 LISTEN      
::1.3493                                *.*                               0      0  128000      0 LISTEN      
::1.25                                  *.*                               0      0  128000      0 LISTEN

I don’t recognise any of those as openHAB ports…

If I can advice then maybe you could start from basic things such running java -version and then trying to run plain karaf 4.0.8 installation. Tar.gz for *nix systems is here. Start command is bin/karaf and it should give you access to local console with few modules. Log directory is ${karaf.home}/data/logs. In bin/contrib you can find karaf-service-template.solaris-smf which might be useful while porting OH to this platform.

I downloaded the karaf version you linked to and it doens’t seem to start either…
I attached a dtrace probe using:

dtrace -n ‘proc:::exec-success { printf("%d %s", timestamp, curpsinfo->pr_psargs); }’

and got the log below (it’s actually much longer). It seems like it’s stuck in a loop.

3   2774         exec_common:exec-success 13701034740196517 basename ./karaf
   3   2774         exec_common:exec-success 13701034741563289 ls -l karaf
   3   2774         exec_common:exec-success 13701034750148401 basename ./karaf
   3   2774         exec_common:exec-success 13701034751490882 ls -l karaf
   3   2774         exec_common:exec-success 13701034756688018 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034764053846 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034772039905 basename ./karaf
   3   2774         exec_common:exec-success 13701034793390589 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034795465471 ls -l karaf
   3   2774         exec_common:exec-success 13701034798580611 dirname rwxr
   3   2774         exec_common:exec-success 13701034808394710 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034818317227 basename ./karaf
   3   2774         exec_common:exec-success 13701034819658361 ls -l karaf
   3   2774         exec_common:exec-success 13701034824901811 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034832185985 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034834300045 ls -l karaf
   3   2774         exec_common:exec-success 13701034837399540 dirname rwxr
   3   2774         exec_common:exec-success 13701034844648565 dirname rwxr
   3   2774         exec_common:exec-success 13701034852339549 dirname rwxr
   3   2774         exec_common:exec-success 13701034864501043 basename ./karaf
   3   2774         exec_common:exec-success 13701034865863220 ls -l karaf
   3   2774         exec_common:exec-success 13701034872957211 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034880966296 basename ./karaf
   3   2774         exec_common:exec-success 13701034882320039 ls -l karaf
   3   2774         exec_common:exec-success 13701034887548402 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034895525356 basename ./karaf
   3   2774         exec_common:exec-success 13701034896902170 ls -l karaf
   3   2774         exec_common:exec-success 13701034902767341 basename ./karaf
   3   2774         exec_common:exec-success 13701034904144895 ls -l karaf
   3   2774         exec_common:exec-success 13701034909324639 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034917334414 basename ./karaf
   3   2774         exec_common:exec-success 13701034921832024 dirname rwxr
   3   2774         exec_common:exec-success 13701034944276297 basename ./karaf
   3   2774         exec_common:exec-success 13701034967903680 basename ./karaf
   3   2774         exec_common:exec-success 13701034982170895 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701034985879832 ls -l karaf
   3   2774         exec_common:exec-success 13701034993122681 dirname rwxr
   3   2774         exec_common:exec-success 13701035005461019 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701035007553647 ls -l karaf
   3   2774         exec_common:exec-success 13701035028166085 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701035030280956 ls -l karaf
   3   2774         exec_common:exec-success 13701035033473916 dirname rwxr
   3   2774         exec_common:exec-success 13701035042227910 dirname rwxr
   3   2774         exec_common:exec-success 13701035049567466 dirname rwxr
   3   2774         exec_common:exec-success 13701035057042649 dirname rwxr
   3   2774         exec_common:exec-success 13701035072158969 dirname rwxr
   3   2774         exec_common:exec-success 13701035079931335 dirname rwxr
   3   2774         exec_common:exec-success 13701035091302728 basename ./karaf
   3   2774         exec_common:exec-success 13701035114648553 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701035116776774 ls -l karaf
   3   2774         exec_common:exec-success 13701035119939237 dirname rwxr
   3   2774         exec_common:exec-success 13701035134695662 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701035138461378 ls -l karaf
   3   2774         exec_common:exec-success 13701035156538295 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701035158679245 ls -l karaf
   3   2774         exec_common:exec-success 13701035161889984 dirname rwxr
   3   2774         exec_common:exec-success 13701035180174111 awk -F->  {print $2}
   3   2774         exec_common:exec-success 13701035182516085 ls -l karaf
   3   2774         exec_common:exec-success 13701035185646245 dirname rwxr
   3   2774         exec_common:exec-success 13701035195992680 basename ./karaf
   3   2774         exec_common:exec-success 13701035219394212 awk -F->  {print $2}

PS4='Line ${LINENO}: ’ bash -x ./karaf

LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .
LLLine 25: awk '-F-> ' '{print $2}'
LLLLine 25: basename ./karaf
LLLine 25: ls -l karaf
LLine 25: LINK=rwxr
LLine 23: '[' rwxr ']'
LLLine 24: dirname rwxr
LLine 24: cd .

Seems to be stuck in this code in the “karaf” script:

realpath() {
OURPWD=${PWD}
cd “$(dirname “${1}”)” || exit 2
LINK=$(ls -l “$(basename “${1}”)” | awk -F"-> " ‘{print $2}’)
while [ “${LINK}” ]; do
cd “$(dirname “${LINK}”)” || exit 2
LINK=$(ls -l “$(basename “${1}”)” | awk -F"-> " ‘{print $2}’)
done
REALPATH="${PWD}/$(basename “${1}”)"
cd “${OURPWD}” || exit 2
echo “${REALPATH}”
}

I’ll guess I will have stuff to do this evening…

I spoken with my friend and he said last version of Karaf tested under solaris was 3.0.x, however I see differences between 3.0.6, 3.0.7 and 3.0.8 (same as Karaf 4):


Definitelly there might be something wrong with while loop trying to resolve all links. Please let me know if you will find any pointers so I we can report it back to Karaf. Issue which was trying to resolve some troubles and introduced this function is here: https://issues.apache.org/jira/browse/KARAF-4564

Thanks! Karaf 3.0.8 works but not 4.0.8…

I’ve created bug for tracking this issue in Karaf: https://issues.apache.org/jira/browse/KARAF-4949. In general these startup scripts are doing same thing and all magic is happening in java after process is launched. You could potentially try to run K4 with K3 script as temporary workaround. :slight_smile:

Thank. I’ll continue there and post the result here when the issue is solved.

Possible solution found! I will have to test it more tonight.

I used these files:

apache-karaf-3.0.8.tar.gz
openhab-2.0.0.RC1.tar.gz

and did this:

robert@server:/pool/home/robert/openhab/openhab2$ ls
apache-karaf-3.0.8.tar.gz  extract-and-patch          openhab-2.0.0.RC1.tar.gz
robert@server:/pool/home/robert/openhab/openhab2$ cat extract-and-patch 
#!/bin/bash

set -e

rm -rf apache-karaf-3.0.8 openhab2
/usr/gnu/bin/tar xfvz apache-karaf-3.0.8.tar.gz
mkdir openhab2
(cd openhab2 && /usr/gnu/bin/tar xfvz ../openhab-2.0.0.RC1.tar.gz)

cp ./apache-karaf-3.0.8/bin/karaf ./openhab2/runtime/bin/karaf
cp ./apache-karaf-3.0.8/bin/instance ./openhab2/runtime/bin/instance

cd openhab2

PS4='Line ${LINENO}: ' \
CLASSPATH=`pwd`/runtime/lib/boot/* \
bash -x ./start.sh

./extract-and-patch

lots of text..
lots of text..
lots of text..

                             __  _____    ____      

____ ____ ___ ____ / / / / | / __ )
/ __ / __ / _ / __ / // / /| | / __ |
/ /
/ / // / __/ / / / __ / ___ |/ // /
_/ ./_// /// /// |/_____/
/_/ 2.0.0.RC1
- local build -

Hit ‘’ for a list of available commands
and ‘[cmd] --help’ for help on a specific command.
Hit ‘’ or type ‘system:shutdown’ or ‘logout’ to shutdown openHAB.

openhab>