openhab / openhab-linuxpkg

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

cannot change port number via /etc/default/openhab2 #23

Closed CWempe closed 7 years ago

CWempe commented 7 years ago

Changing the port number for http and https via /etc/default/openhab2 does not work.

The user can set the values like this: OPENHAB_HTTP_PORT=9090 OPENHAB_HTTPS_PORT=9091

but the variables are empty inside /usr/share/openhab2/runtime/bin/setenv.

Reproduced on Raspbian Wheezy.

see: https://community.openhab.org/t/changing-port-number-on-openhab-2-0/2300/42

BClark09 commented 7 years ago

Hi @CWempe, I first see if this problem is specific to sysVinit systems such as Wheezy. And will hopefully have a fix soon.

CWempe commented 7 years ago

Great. No hurry. I am just starting to play with OH2 on a test system. :)

If I can help in any way, let me know.

Dan1001 commented 7 years ago

I have the same issue on xubuntu 14.04 (with the repository packaged OH2 snapshot)

Hect0rG commented 7 years ago

Same issue on Ubuntu 16.04 LTS. Is there a workaround?

Dan1001 commented 7 years ago

My first workaround was editing /usr/share/openhab2/runtime/karaf/bin/setenv directly, which works but is irritating because you need to redo this with every update

My second workaround is not having a workaround, and instead changing the port on my other application...

BClark09 commented 7 years ago

It looks like it's being stripped as soon as the service is started.

What happens when any of you set a system-wide variable in /etc/environment?

OPENHAB_HTTP_PORT=9090
OPENHAB_HTTPS_PORT=9091

may require a reboot.

CWempe commented 7 years ago

makes no difference.

I set the variables in /etc/enviroment and rebooted. "env" shows the variables are active for my user but not for "sudo env".

The start script does not see the env variables either.

Hect0rG commented 7 years ago

I was missing the OPENHAB_ in front of my variables when I added that and restarted the service it worked.

jerrod-lankford commented 7 years ago

+1 also having this issue with ubuntu 14.04

BClark09 commented 7 years ago

You'll be glad to know that this works in the latest version of the packages. (Thanks @ralle12345 )

Simply add the following lines to /etc/default/openhab2

OPENHAB_HTTP_PORT=9090
OPENHAB_HTTPS_PORT=9091
JannikZed commented 7 years ago

and where is this file located on MacOSX? Openhab Documentation is so bad ...

BClark09 commented 7 years ago

@JannikZed, only the apt installation uses a specific file for relevant settings . As mentioned in the "Security and Remote Access" page, for other installations this is best done by setting the above as environment variables.