Re: [systemd-devel] Storing Data on systemd bus

2017-02-06 Thread Lennart Poettering
On Mon, 06.02.17 12:54, guhan balasubramanian (guhan@gmail.com) wrote:

> Hi,
> 
> I've followed the tutorial on the 0pointer blog [1] for creating a 'system'
> service.
> I am currently held up with two questions which would help me come up with
> a better design for my "inventory" program.
> 
>1. Is it possible to use sd-bus API as an inventory to store and
>retrieve data? Whether sd-bus internally would store the data in the bus
>forever until deleted, something like a message queue?

D-Bus is an IPC system, for delivering control messages between
processes.

It's not a storage system, and while messages are queued on it, you
cannot read them out of order, the messages have to be "small", and
you will be kicked off the bus if you stop processing your incoming
messages for too long.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Storing Data on systemd bus

2017-02-06 Thread guhan balasubramanian
Hi,

I've followed the tutorial on the 0pointer blog [1] for creating a 'system'
service.
I am currently held up with two questions which would help me come up with
a better design for my "inventory" program.

   1. Is it possible to use sd-bus API as an inventory to store and
   retrieve data? Whether sd-bus internally would store the data in the bus
   forever until deleted, something like a message queue?
   2. If above question has a positive answer, I am trying to get and set
   properties by creating a service (Example 1 in Reference - Busctl Man
   Page ). I
   am doing this on the system bus, but I am not able to '*store the data
   in the bus'* as in the example. For now, I am only able to store data in
   the '*process memory' *as global variables.  [2] doesn't seem to help
   much as the bus is not storing the data using SD_BUS_WRITABLE_PROPERTY. Is
   there a reference code or documentation I can refer to?

Please advise and thanks in advance!

-Guhan

References:
1. http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html
2.
https://github.com/systemd/systemd/blob/master/src/libsystemd/sd-bus/test-bus-objects.c
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel