openhab-distro icon indicating copy to clipboard operation
openhab-distro copied to clipboard

SSH connection hangs connecting to Karaf log

Open Josar opened this issue 6 years ago • 2 comments

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

Josar avatar Mar 12 '18 12:03 Josar

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 {...})

BClark09 avatar Mar 12 '18 14:03 BClark09

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

Josar avatar Mar 12 '18 15:03 Josar