openhab / openhab-qnap-qpkg

openHAB Packages for QNAP NAS systems
Eclipse Public License 2.0
77 stars 21 forks source link

Openhab does not listen on port 8090 #20

Open stefan-hoehn opened 7 years ago

stefan-hoehn commented 7 years ago

I started openhab via the app center and it said it would run but opening it on 8090 did not result in any response.

I then killed it (btw I then found that the KARAF instance still had the PID set in the instance.properties file which I had to remove first).

I then started "openhab.sh console" manually in the shell and it stays there (as it starts the jvm).
Again, no response from port 8090. I checked netstat -a | grep 8090 and it reveals nothing (which confirms the fact that the application is not listening on 8090)

I checked the command line and it says: /usr/local/jre/bin/java -Dopenhab.home=/share/MD0_DATA/.qpkg/openHAB/distribution -Dopenhab.conf=/share/MD0_DATA/.qpkg/openHAB/distribution/conf -Dopenhab.runtime=/share/MD0_DATA/.qpkg/openHAB/distribution/runtime -Dopenhab.userdata=/share/MD0_DATA/.qpkg/openHAB/distribution/userdata -Dopenhab.logdir=/share/MD0_DATA/.qpkg/openHAB/distribution/userdata/logs -Dfelix.cm.dir=/share/MD0_DATA/.qpkg/openHAB/distribution/userdata/config -Dorg.osgi.service.http.port=8090 -Dorg.osgi.service.http.port.secure=8444 -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/local/jre/jre/lib/endorsed:/usr/local/jre/lib/endorsed:/share/MD0_DATA/.qpkg/openHAB/distribution/runtime/lib/endorsed -Djava.ext.dirs=/usr/local/jre/jre/lib/ext:/usr/local/jre/lib/ext:/share/MD0_DATA/.qpkg/openHAB/distribution/runtime/lib/ext -Dkaraf.instances=/share/MD0_DATA/.qpkg/openHAB/distribution/runtime/instances -Dkaraf.home=/share/MD0_DATA/.qpkg/openHAB/distribution/runtime -Dkaraf.base=/share/MD0_DATA/.qpkg/openHAB/distribution/userdata -Dkaraf.data

From what I understood, it then calls the start.sh in the distribution directory and this in turns calls karaf which I can confirm with ps -ef

/bin/bash /share/MD0_DATA/.qpkg/openHAB/distribution/runtime/bin/karaf

I then patched the openhab.sh to use start_debug.sh of karaf but it does not reveal more information except "Listening for transport dt_socket at address 5005"

Any idea how to further analyze and track down the problem?

cheers Stefan

p-junker commented 7 years ago

I seem to have the same Problem. I installed openHAB2 following the instructions, but I can not call it on port 8090.

@stefan-hoehn: did you find a solution yourself which you could share?

@all: does anybody else have an idea how to get it working?

Thanks in advance for your help.

Regards Patrik

stefan-hoehn commented 7 years ago

No, not really. Though I noticed that it conflicts with the squeezebox server I have at the QNAP as well. As soon as openhab is running the squeezebox server does not work anymore. There must be some conflict which could not find out. Sorry.

thopiekar commented 7 years ago

With the 2.0.0-2 package you shall be able to set the http and https port to a port you like. Just create (.. distro/)conf/qpkg/http.port or (.. distro/)conf/qpkg/https.port and write only the port number into these files. Re-/starting openHAB should use these ports then.

(Currently practically untested, but should work.)

stefan-hoehn commented 7 years ago

I am not sure about the right destination of that file because there is no ./config - directory in the distribution-folder. Do you mean ./distribution/conf and if so, within that directory there is not yet a qpkg-folder. Do I have create that folder too and then create the two files there like /share/MDE0_DATA/.qpkg/openHAB/distribution/conf/qpkg/http.port?

thopiekar commented 7 years ago

That is correct. I should edit it.

Sorry for the confusion!

exo1987 commented 7 years ago

HI thopiekar,

unfortunately I am not able to change the port by creating these files. I am using QTS 4.3.3. Did you already test this?

kind regards exo

stefan-hoehn commented 7 years ago

I doesn't seem to work for me either.

thopiekar commented 7 years ago

Hmm, also doesn't work for me. Looks like setting the environment variables is not enough. Or these have been renamed?! Sadly I'm not familiar whether something has changed over here or not. Can someone research, how to change the port while starting openHAB?

Thanks!

(@kaikreuzer: ping) (reference: https://github.com/openhab/openhab-qnap-qpkg/commit/9aebf660a1291814a6f1b1e5567a6aa5e6f8ba49)

kaikreuzer commented 7 years ago

Setting the environment variables OPENHAB_HTTP_PORT and OPENHAB_HTTPS_PORT should normally do the job. So I fear I cannot be of much help here - you will have to check, why your setting isn't correctly picked up.

thopiekar commented 7 years ago

Hmm, I added some echos between this line (https://github.com/openhab/openhab-qnap-qpkg/blob/master/shared/openHAB.sh#L147) and it returns the port numbers like I set in my http.port and https.port files. I wonder why it is not using it when starting up. The code after this line also verifies that these ports are also not in use, so I see no special reason why OH2 shouldn't be able to use them.