Piping the output of hologram receive into netcat does not seem to work


#1

I want to be listening all the time for incoming messages and since the CLI API requires sudo I thought why not create a system service that starts at boot to listen and forward any the received messages over a local socket for user space processing. I’m running the latest jessie on a RPi.

Running as a user I do this:

nc -l localhost 3001

Running as root I do this:

hologram receive | nc localhost 3001

Then I use web hook and the POST method to send some data

curl -s -d "@mydata.txt" -X POST <my web host URL>

but no messages come through to the user space. When I break it apart to just

hologram receive

and then the above curl line I can verify that receiving works just fine.

And I can get data across my local socket using:

echo test | nc localhost 3001

So why wouldn’t this work?

hologram receive | nc localhost 3001

Or is there an easier way to listen for data without needing sudo?


#2

Hi @jimcam,

If I’m understanding your question correctly,

this works:
hologram receive (able to see the messages come through)

but this doesn’t:
hologram receive | nc localhost 3001

Is this correct? It might be a logging issue, but I’ll have to look at the source code to verify this. The reason why you need sudo here is because some of the underlying services need to run with root access (think network interfaces). We’re planning to ship workarounds for this. Stay tuned.


#3

Hi @jimcam,

I was able to reproduce the bug that you see here. I hope to have a solution for you soon.


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.