OpenHab start problem os X 10.11

After an upgrade from os X 10.10 too os X 10.11 my openhab installation doesn’t load anymore. I have os X Server and openhab on the same machine. Maybe thats part of the problem? I think the problem is related to a network port collision on port 8443. I don’t know how to solve this problem, anyone with a suggestion?

This is a part of error message when openhab tries too load
Launching the openHAB runtime…
osgi> 2015-10-06 21:02:47.964 [WARN ] [.u.component.AbstractLifeCycle] - FAILED SslSelectChannelConnector@0.0.0.0:8443: java.net.BindException: Address already in use
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_25]
at sun.nio.ch.Net.bind(Net.java:436) ~[na:1.8.0_25]
at sun.nio.ch.Net.bind(Net.java:428) ~[na:1.8.0_25]

Yep, that is a port conflict problem. There are two ways to fix it.

  1. Figure out what other program is on port 8443 and move it to another port or shut it down.

  2. Move openHAB to another port by editing the openhab.sh script in the bin folder (NOTE: I’m on Linux and making a huge assumption that it works the same way on OSX). You will probably want to move both the HTTP_PORT and HTTPS_PORT.

1 Like

Thank you this solved almost every openhab problem i had. I changed the port settings in the file start.sh this was probably the easiest solution, too mess with Apple’s server ports, well that could be a bit harder I think :wink:

There is only a little problem left too solve. If I write sudo sh start.sh at the command line it works just fine. To start openhab as a daemon I use a .plist file, it seems that the network ports doesn’t change when I start it this way, maybe start.sh isn’t involved then? Perhaps I have too make some changes too the .plist file? But I don’t know how.

I tried to attach the text from .plist file but it’s a xml file and in the preview window I did loose the <> char’s so it looked a bit messy.

1 Like

Unfortunately I don’t know much about OSX or BSD so I’m not sure how much help I can be on that front. But I can provide what I do know on the Linux side and hopefully it might direct you in the right direction.

BTW, if you highlight a chunk of text in the edit field for these posts and press <ctrl>-k, press the </> symbol above, if it is multiple lines indent by four spaces, or for inline text quote it using back quotes it will treat the text as code and not strip out the ,.

On Linux openhab gets installed to /usr/share/openhab with the start script being placed in /etc/init.d/ This start script calls /usr/share/openhab/bin/openhab.sh to launch the application and it is this openhab.sh script that has the HTTP_PORT and HTTPS_PORT properties.

Good luck!

Rich

I had the same problem a couple of weeks ago and I haven’t updated to El Capitan yet. I’m certain it was caused by an update to OS X Server.

I did the upgrade of OS X Server and El Capitan at the same time so I didn’t realize what was the main problem.
How did you solve the problem, and which method do you use to start openhab?

Thanks in advance

I tried many things to stop the Apple stack listening on 8443. In the end I gave up and moved openHAB to 7443.

Ok, i’ve tried to move openhab too an other port by change the settings in the start.sf file. That works well when I start openhab with start.sh from the command line.
But when I start openhab as a service using a .plist file the settings in start.sh isn’t used.

How do you start openhab? Automatically using a .plist file or do you have a better solution too share.

Thanks

My /Library/LaunchDaemons/org.openhab.openHAB.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
<plist version="1.0">
<dict>
        <key>KeepAlive</key>
        <dict>
                <key>SuccessfulExit</key>
                <false/>
        </dict>
        <key>Label</key>
        <string>org.openhab.openHAB</string>
        <key>ProgramArguments</key>
        <array>
                <string>/opt/openhab/current/start.sh</string>
        </array>
        <key>UserName</key>
        <string>openhab</string>
        <key>StandardOutPath</key>
        <string>/var/log/openhab/openhab.log</string>
        <key>StandardErrorPath</key>
        <string>/var/log/openhab/openhab_err.log</string>
</dict>
</plist>

In start.sh I’ve changed HTTPS_PORT to 7443. Actually I’ve also configured jetty to listen on a completely different port as well by adding a new <Call name="addConnector"> section to jetty.xml, but the port number is passed in via start.sh in exactly the same way as HTTP_PORT and HTTPS_PORT.

What does your .plist file look like?

My .plist file looks like this, and I se that your file seems to be a bit more logically. I’ll try your version little later, thanks for the tip. Know i have too help my wife with the house cleaning…
> <?xml version="1.0" encoding="UTF-8"?>
>
>
>
> Disabled
>
> EnvironmentVariables
>
> PATH
> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/sbin
>
> GID
> 0
> KeepAlive
>
> Label
> org.openhab.daemon
> OnDemand
>
> ProgramArguments
>
> /bin/launchctl
> load
> -w
> /Library/LaunchDaemons/org.openhab.daemon.plist
>
> RunAtLoad
>
> UserName
> root
>
>

Sorry, my upload of .plist file didn’t work. But I’m up and running thanks to your .plist file.
With some small modifications of the path it now works perfectly.

Thanks a lot :slight_smile:

Sorry, my upload of .plist file didn’t work. But I’m up and running thanks to your .plist file.

Great!

With some small modifications of the path it now works perfectly.

On my system, /opt/openhab/current is a symlink to the version in use (e.g. /opt/openhab/openhab-1.7.1

There are various symlinks set up within the app as well, e.g. logs -> /opt/openhab/logs, configurations -> /opt/openhab/configurations, etc/zwave -> /opt/openhab/etc/zwave etc.

I also have a git commit hook in a repo in my home directory on that server so that it checks out the latest in /opt/openhab/configurations every time I push. It means I can update my configuration on my notebook, then commit and push, and openHAB automatically picks up the changes.

I should write it up on the wiki at some point!

It’s obvious that your setup slightly are a bit more technical advanced than my skills. Sounds great if you can write that wiki some time.

Cheers

It also worked for me. just changed the HTTPS_PORT=8445 from 8443, as 8443 was being used by some server program.