Python, Daemons and D-Bus

Discussion in 'Python' started by PurpleServerMonkey, May 24, 2008.

  1. Seeking feedback from group members on a design I'm looking at using
    in a project.

    I've created an XML-RPC server and a number of Daemons, the idea is
    that the XML-RPC server gets a request from a user interface of some
    sort and then sends data to the Daemon processes to do work. Daemons
    will also need to feed back task information to the XML-RPC server.

    For the communications between the Daemons and XML-RPC server I was
    thinking of using D-Bus (The project is for Linux and *BSD) but wanted
    to hear what others thought of the idea?

    Would you use D-Bus or a more traditional IPC method such as sockets?
    Although D-Bus is relatively new it looks interesting, just not sure
    it would work well in this kind of project.

    Thanks in advance for your thoughts and opinions.
    PurpleServerMonkey, May 24, 2008
    #1
    1. Advertising

  2. [ PurpleServerMonkey <> ]

    > Would you use D-Bus or a more traditional IPC method such as sockets?
    > Although D-Bus is relatively new it looks interesting, just not sure
    > it would work well in this kind of project.


    DBus is not really intended for private communication between processes of
    the same application, but more for intercommunication between different
    applications. If the IPC interface of your backend daemons is intended to
    be used by other applications, DBus is the right choice, otherwise I would
    choose something different.

    The reason is, that DBus doesn't know about applications. It exposes all
    objects registered on the bus to every DBus client on the system and so
    makes you application-private API available to the public (and spams the
    bus with lots of generally useless objects ;) ).

    In case your IPC interface is application private, a custom IPC protocol
    (probably using XML RPC over unix sockets) is better suited.

    Moreover you should make your choice dependent on the type of data you
    transmit. Both DBus and XML-RPC wrap calls into XML messages, which is
    terribly inefficient for large binary data.

    --
    Freedom is always the freedom of dissenters.
    (Rosa Luxemburg)
    Sebastian 'lunar' Wiesner, May 24, 2008
    #2
    1. Advertising

  3. On May 25, 5:46 am, Sebastian 'lunar' Wiesner <>
    wrote:
    > [ PurpleServerMonkey <> ]
    >
    > > Would you use D-Bus or a more traditional IPC method such as sockets?
    > > Although D-Bus is relatively new it looks interesting, just not sure
    > > it would work well in this kind of project.

    >
    > DBus is not really intended for private communication between processes of
    > the same application, but more for intercommunication between different
    > applications.  If the IPC interface of your backend daemons is intended to
    > be used by other applications, DBus is the right choice, otherwise I would
    > choose something different.
    >
    > The reason is, that DBus doesn't know about applications.  It exposes all
    > objects registered on the bus to every DBus client on the system and so
    > makes you application-private API available to the public (and spams the
    > bus with lots of generally useless objects ;) ).
    >
    > In case your IPC interface is application private, a custom IPC protocol
    > (probably using XML RPC over unix sockets) is better suited.
    >
    > Moreover you should make your choice dependent on the type of data you
    > transmit.  Both DBus and XML-RPC wrap calls into XML messages, which is
    > terribly inefficient for large binary data.
    >
    > --
    > Freedom is always the freedom of dissenters.
    >                                       (Rosa Luxemburg)


    Thanks Sebastian,

    Your comments make a lot of sense. I was thinking of creating a custom
    session channel and using that for my purposes but as you mentioned
    it's not very secure and I do want to keep the server to daemon
    traffic private, the server has an XML-RPC interface with a public
    API.

    Will definitely look at using a different IPC mechanism for this part
    of the project.
    PurpleServerMonkey, May 25, 2008
    #3
  4. PurpleServerMonkey schrieb:
    > On May 25, 5:46 am, Sebastian 'lunar' Wiesner <>
    > wrote:
    >> [ PurpleServerMonkey <> ]
    >>
    >>> Would you use D-Bus or a more traditional IPC method such as sockets?
    >>> Although D-Bus is relatively new it looks interesting, just not sure
    >>> it would work well in this kind of project.

    >> DBus is not really intended for private communication between processes of
    >> the same application, but more for intercommunication between different
    >> applications. If the IPC interface of your backend daemons is intended to
    >> be used by other applications, DBus is the right choice, otherwise I would
    >> choose something different.
    >>
    >> The reason is, that DBus doesn't know about applications. It exposes all
    >> objects registered on the bus to every DBus client on the system and so
    >> makes you application-private API available to the public (and spams the
    >> bus with lots of generally useless objects ;) ).
    >>
    >> In case your IPC interface is application private, a custom IPC protocol
    >> (probably using XML RPC over unix sockets) is better suited.
    >>
    >> Moreover you should make your choice dependent on the type of data you
    >> transmit. Both DBus and XML-RPC wrap calls into XML messages, which is
    >> terribly inefficient for large binary data.
    >>
    >> --
    >> Freedom is always the freedom of dissenters.
    >> (Rosa Luxemburg)

    >
    > Thanks Sebastian,
    >
    > Your comments make a lot of sense. I was thinking of creating a custom
    > session channel and using that for my purposes but as you mentioned
    > it's not very secure and I do want to keep the server to daemon
    > traffic private, the server has an XML-RPC interface with a public
    > API.
    >
    > Will definitely look at using a different IPC mechanism for this part
    > of the project.


    If you can - use Pyro. It is easy, fast and can be made secure using SSL
    AFAIK.

    Diez
    Diez B. Roggisch, May 25, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. about daemons and IPC

    , Aug 27, 2006, in forum: Python
    Replies:
    4
    Views:
    310
    Irmen de Jong
    Aug 29, 2006
  2. Replies:
    2
    Views:
    423
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Sep 13, 2006
  3. Andrey
    Replies:
    0
    Views:
    340
    Andrey
    Sep 12, 2007
  4. Steven W. Orr
    Replies:
    0
    Views:
    422
    Steven W. Orr
    Sep 14, 2007
  5. Fernando M. Maresca

    logging and daemons

    Fernando M. Maresca, Feb 16, 2009, in forum: Python
    Replies:
    1
    Views:
    282
    Diez B. Roggisch
    Feb 16, 2009
Loading...

Share This Page