openhab / openhab-distro

The binary distribution of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.29k stars 394 forks source link

deb-package: etc/org.apache.karaf.shell.cfg gets overwritten each update #533

Open euphi opened 6 years ago

euphi commented 6 years ago

Each time I update openhab2 (nightly build), the Karaf Shell configuration /var/lib/openhab2/etc/org.apache.karaf.shell.cfg gets overwritten.

As it contains the sshHost that is set to localhost by default, this stops external login.

(Luckily, sshd key configuration is kept, so after changing sshHost back to 0.0.0.0 everything is fine again.

BClark09 commented 6 years ago

Whilst this specific problem belongs at openhab/openhab-linuxpkg org.apache.karaf.shell.cfg also gets replaced with the distro's upgrade scripts in this repository. @kaikreuzer, is this file safe to keep?

kaikreuzer commented 6 years ago

Well, it is safe as long as we do not do any upgrade of Karaf, which changes the content of that file... I am wondering if we should disallow manual editing of the karaf*.cfg files and rather ask users to put their settings into services/runtime.cfg. @euphi Could you try to add

org.apache.karaf.shell:sshHost = <yourhost>

to that file and see if that does the trick?

euphi commented 6 years ago

Yes, that did the trick. Many thanks for the hint.

I leave the issue open, because I suggest to update http://docs.openhab.org/administration/console.html accordingly.

ThomDietrich commented 6 years ago

Sounds like an excellent solution. In the docs article we are suggesting to change sshHost and sshPort. Let's add commented settings lines to runtime.cfg and change the docs article accordingly. Everyone aboard?

@euphi Would you like to add the PR for both?

euphi commented 6 years ago

Its not that easy for the documentation, because

ThomDietrich commented 6 years ago

Hey @euphi,

the openHAB configuration directory is to be called $OPENHAB_CONF, see https://github.com/openhab/openhab-docs/issues/189. However that is not yet reflected in the Linux article and should be part of a separate Pull Request. Your solution is okay for now.

We can't cover all settings but while you are at it it would be good if you can also cover sshPort.

user.properties is another issue. @kaikreuzer any solution for that?

mstormi commented 3 years ago

After an apt upgrade, access to Karaf was no longer possible because the upgrade has overwritten the title file. So this is still an issue. To manually adjust it every time is not what I'd call an "excellent" solution. @BClark09 Ben any chance to migrate the file as a more adequate solution ?