start multiple instance of the same service ?

frederic heem frederic.heem at telsey.it
Fri Sep 15 01:39:32 PDT 2006


Alle 18:13, giovedì 14 settembre 2006, John (J5) Palmieri ha scritto:
> On Thu, 2006-09-14 at 09:21 -0400, Havoc Pennington wrote:
> > frederic heem wrote:
> > > Hi,
> > > Is there a way to start multiple instance of the same service ?
> > > It seems that at the moment, only one instance of the service is
> > > started by the daemon.
> > > The requirement is that a client get a new proxy given the name of the
> > > service, not the object name. The daemon shall be able to start one
> > > service per client, not one service for all clients.
> > > For example, let's say that a packet capture service is called dumpcap,
> > > many clients shall be able to request this service, for examples, one
> > > captures on eth0 and the other one on eth1. Each clients needs its own
> > > dumpcap process, sharing the process is not possible without rewriting
> > > dumpcap. Is it already possible or is it something that require
> > > modifying dbus itself ?
> >
> > It's not possible. But you could have a service factory service perhaps,
> > that starts a dumpcap for each network interface.
> >
> > Havoc
>
> This sounds like the right way to do it.  Basically have one factory,
> org.dummy.dumpcap for example, and have a method such as StartInstance()
> which execs the actual provider and sends back a unique bus name.  You
> could even get fancy and have the provider also become its own bus
> server and send a socket to connect to avoiding the overhead of the bus.

Actually, this sounds like writing from scratch a kind of dbus-daemon that is 
able to launch multiple instance. Why not modifying the dbus-daemon itself ? 
It already has (portable ?) mechanism to launch program with a baby sitter.
It could be also useful for other applications that wish to start multiple 
instance of another program.
One idea behind using dbus is too avoid launching application myself but 
delegates this work to dbus. The other idea is to avoid feeding and analyzing 
the standard input and output of the program.
On the service side, let's add a new flag, for example:
org_freedesktop_DBus_request_name(pProxy, 
                                         SNIFFER_INTERFACE, 
                                         DBUS_NAME_FLAG_NEW_INSTANCE,
                                         &ui32RequestNameReturn, 
                                         &pError)
On the client side, let's pass NULL as the name to indicate the daemon to 
create a new instance of the service, example:
dbus_g_proxy_new_for_name_owner (connection,
                                           NULL,
                                           SNIFFER_OBJECTNAME,
                                           SNIFFER_INTERFACE, ,
                                           &error);
Then a function has to return the name of the new object created by the 
daemon:
const char* dbus_g_proxy_name_get(pProxy)
What do you think of this proposal ?


______________________________________________________________________________

--- NOTICE ---

CONFIDENTIALITY - This  email  and  any  attachments  are confidential and are
intended  for  the  addressee  only.   If  you  have  received this message by
mistake,  please  contact us immediately and then delete the message from your
system.  You  must  not copy, distribute, disclose or act upon the contents of
this email. Thank you.

PERSONAL DATA PROTECTION  (Law  by  Decree  30. 06.2003 n. 196) - Personal and
corporate  data  submitted  will  be used in a correct, transparent and lawful
manner. The data collected will be processed in paper or computerized form for
the performance of contractual  and  lawful  obligations  as  well  as for the
effective management of business relationship. Data may be disclosed, in Italy
or abroad, for the purpose above mentioned to third  parties  which  cooperate
with Telsey, agents, banks, factoring companies,  credit recovering companies,
credit  insurance  companies,  professional  and  consultants,  and   shipping
companies. In relation to the same purposes, data  may  be  processed  by  the
following  classes  of  executors  or  processors:  management; administration
department; logistics  and  purchase  department; sales department; post sales
department quality department; R&D department; IT department; legal department.
The  data  processor  is  Telsey S.p.A.  The data subject may exercise all the
rights set forth in art. 7 of Law by Decree 30. 06.2003 n. 196 as reported  in
in the following link http://www.telsey.it/privacy.jsp. 

______________________________________________________________________________


More information about the dbus mailing list