openhab / openhab-distro

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

SSH connection hangs connecting to Karaf log #653

Open Josar opened 6 years ago

Josar commented 6 years ago

connection hangs when trying to run the openhab-cli log in a one liner.

ssh pi@%openhabhost% openhab-cli console -p habopen log:tail

Somehow the 'log:tail' part makes the output hang up. When i use it in the command line, cygwin bash or power shell the behaviour is the same.

When i omit the 'log:tail' and do following it works fine. But then i have to type it 'log:tail' which i try to get rid of.

ssh pi@%openhabhost% openhab-cli console -p habopen

To narrow it down it happens as soon as the karaf console gets the authentification.

[INFO ] [.server.session.ServerUserAuthService] - Session openhab@/127.0.0.1:34018 authenticated

Any idea wh this could happen? and how to solve it?

https://community.openhab.org/t/karaf-output-stops/41552

BClark09 commented 6 years ago

As a note, doing the same thing on a manual install does the same thing, i.e:

./runtime/bin/client -p habopen log:tail

This may be a Karaf issue, as it seems to be completely unresponsive when nothing is left in the buffer.

This is a strange use-case though, any reason why you can't use openhab-cli showlogs (or the manual install equivalent of tail -f {...})

Josar commented 6 years ago

Awsome thanks, i did not as i just didn't thought of it.

I will use this for now.

ssh pi@%openhabhost% tail -q -f /var/log/openhab2/events.log -f /var/log/openhab2/openhab.log

One remark it is not colored Output though. I use this to configure VSCode to be a very nice all in one editing solution for openhab. File acces SFTP, Auto complete etc and logging in one working Environment.

Here is my usecase. https://community.openhab.org/t/vs-code-openhab-extension/30205/215