0

I'm building a microservices application using the GNU tools and bash and I decided to use dbus-monitor and dbus-send for IPC between services. The problem is that it's hard to make use of the messages received by dbus-monitor since it splits metadata and payload in different lines.

If I instantiate a listener with

dbus-monitor --system interface=org.foo.bar member=test \
 | while read a; do
  echo got message $a
done

and communicate to it with

dbus-send --system --type=signal / org.foo.bar.test string:"hello world"

The output comes as

got line signal time=1676042614.782238 path=; interface=org.foo.bar; member=test
got line string "hello world"

even though string "hello world" is the payload to the message, it was written in a different line.

I tried messing with IFS but no success. I also tried to change parameters to dbus-monitor, but the parameter --profile omits the payload. So I dont know how to solve this.

1 Answer 1

1

Add "type=string" as an expression to the end of the dbus-monitor command if you only want strings.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.