Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-07-04 Thread David Herrmann
Hi

On Sun, Jun 21, 2015 at 4:28 AM, eshark eshar...@163.com wrote:
 Hi,
 After removing /usr/lib/systemd/systemd-cgroups-agent,  all seems to
 work OK.

cgroups-agent is now fixed in -git:
https://github.com/systemd/systemd/commit/0a069ce62de904ae9cbaf23d026ac380b02e50e4

I also fixed kdbus, but haven't pushed it out, yet. It will be
included in the next merge.

Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-20 Thread eshark
Hi,
After removing /usr/lib/systemd/systemd-cgroups-agent,  all seems to work 
OK.


Thank you for your help!


Best Regards,
Li Cheng






At 2015-06-17 18:16:06, eshark eshar...@163.com wrote:

Hi,
 With my kdbus broadcast patch, I found that the systemd process would 
endlessly emit the signal type=signal sender=:1.2 destination=n/a 
object=/org/freedesktop/systemd1/agent interface=org.freedesktop.systemd1.Agent 
member=Released .What does this signal  mean ?


I searched the source codes, and found that systemd-cgroups-agent would  
send this signal. But from the log, systemd-cgroups-agent only send this signal 
several times , not endlessly.


And I cannot locate the place where systemd send such signal. 


Following are the logs:


27[3.633361@3] systemd-cgroups-agent[196]: Lch-sd_bus_emit_signal 
org.freedesktop.systemd1.Agent Released
27[3.633660@2] systemd-cgroups-agent[216]: Lch-sd_bus_emit_signal 
org.freedesktop.systemd1.Agent Released
6[3.633989@2] Lch-kdbus_bus_broadcast: conn_dst-id = 0x14, pid = 216, 
pid name = systemd-cgroups, tid = 216, tid name = systemd-cgroups
30[3.634008@2] systemd-cgroups-agent[216]: Lch-Sent message type=signal 
sender=n/a destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cooki
e=1 reply_cookie=0 error=n/a
30[3.648452@0] systemd[1]: Lch-Got message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cookie
=0 error=n/a
6[3.650378@0] EXT4-fs (mmcblk0p9): re-mounted. Opts: (null)
6[3.652074@3] Lch-kdbus_bus_broadcast: conn_dst-id = 0x12, pid = 196, 
pid name = systemd-cgroups, tid = 196, tid name = systemd-cgroups
30[3.652220@3] systemd-cgroups-agent[196]: Lch-Sent message type=signal 
sender=n/a destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cooki
e=1 reply_cookie=0 error=n/a
6[3.652284@3] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[3.653329@3] systemd[1]: Lch-Sent message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a


30[3.654166@3] systemd[1]: Lch-Got message type=signal sender=:1.20 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
6[3.654642@3] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[3.654784@3] systemd[1]: Lch-Sent message type=signal sender=:1.20 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cook
ie=0 error=n/a
30[3.654958@3] systemd[1]: Lch-Got message type=signal sender=:1.18 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
...


6[  809.109334@1] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[  809.109397@1] systemd[1]: Lch-Sent message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
30[  809.109481@1] systemd[1]: Lch-Got message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cookie
=0 error=n/a
6[  809.109726@1] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[  809.109789@1] systemd[1]: Lch-Sent message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
30[  809.109872@1] systemd[1]: Lch-Got message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cookie
=0 error=n/a






Thanks!
Li Cheng



At 2015-06-17 14:11:11, eshark eshar...@163.com wrote:

Hi,
   I'm so sorry for not giving you more details,  I'm a freshman here, but I'll 
try to do better in the future.
I will give the answers under each of the questions .

At 2015-06-16 18:54:23, David Herrmann dh.herrm...@gmail.com wrote:
Hi

On Tue, Jun 16, 2015 at 12:07 PM, eshark eshar...@163.com wrote:
 At 2015-06-16 15:54:10, David Herrmann dh.herrm...@gmail.com wrote:
Can you be more specific, please? What do you mean by network module
of our systemd cannot work OK?



Does this only happen with kdbus?
Yes.  It's OK with DBus.
Does this only happen with you kdbus-patch to make broadcasts being
sent to oneself?
Yes. 

Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-17 Thread eshark
Hi,
   I'm so sorry for not giving you more details,  I'm a freshman here, but I'll 
try to do better in the future.
I will give the answers under each of the questions .

At 2015-06-16 18:54:23, David Herrmann dh.herrm...@gmail.com wrote:
Hi

On Tue, Jun 16, 2015 at 12:07 PM, eshark eshar...@163.com wrote:
 At 2015-06-16 15:54:10, David Herrmann dh.herrm...@gmail.com wrote:
Can you be more specific, please? What do you mean by network module
of our systemd cannot work OK?



Does this only happen with kdbus?
Yes.  It's OK with DBus.
Does this only happen with you kdbus-patch to make broadcasts being
sent to oneself?
Yes. Without modifying kdbus_bus_broadcast(),  I can always get the ip.
Or does it happen with unmodified kdbus, too?
Never.
What exactly changes?
I just commented out the following two lines in the kdbus_bus_broadc
// if (conn_dst-id == kmsg-msg.src_id)
//continue;


Does everything work perfectly well without kdbus?
As for network, it did work well without my patch.


Is the missing DHCP connectivity the only difference you see with kdbus?
Acctually, I  cannot connet to the device by adb. But  I did run netcfg in 
the terminal, and eth0 didn't get ip as before.


What kdbus version do you run?
kdbus-4.1-rc1
What kdbus tree do you use?
https://git.kernel.org/cgit/linux/kernel/git/gregkh/char-misc.git/
What systemd version do you use? (in case of git: which commit?)
systemd v219 
commit: d736e4f3e76daca4ab1b1fc444737e5ee20a27cd


Did you pass --enable-kdbus to systemd?
Yes , I did.
What upstream kernel version do you use?
3.10.33, we back-ported the kdbus to our kernel.


Any obscure messages in the system-log that you didn't see before? 
From dmesg , I can see that the systemd process  calls kdbus_bus_broadcast() 
endlessly, and the condition  if (conn_dst-id == kmsg-msg.src_id) is always 
true.
It seems that  when booting,  the systemd  process enters a  dead loop by  
sending some signal to the source connection. 
So , systemd cannot boot any  service , including network.


Thanks!
Li Cheng 
...

Please try to paste as much information as possible. Otherwise, it's
really a hassle to ask for each piece of information separately.

Thanks
David









___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-17 Thread eshark
Hi,
 With my kdbus broadcast patch, I found that the systemd process would 
endlessly emit the signal type=signal sender=:1.2 destination=n/a 
object=/org/freedesktop/systemd1/agent interface=org.freedesktop.systemd1.Agent 
member=Released .What does this signal  mean ?


I searched the source codes, and found that systemd-cgroups-agent would  
send this signal. But from the log, systemd-cgroups-agent only send this signal 
several times , not endlessly.


And I cannot locate the place where systemd send such signal. 


Following are the logs:


27[3.633361@3] systemd-cgroups-agent[196]: Lch-sd_bus_emit_signal 
org.freedesktop.systemd1.Agent Released
27[3.633660@2] systemd-cgroups-agent[216]: Lch-sd_bus_emit_signal 
org.freedesktop.systemd1.Agent Released
6[3.633989@2] Lch-kdbus_bus_broadcast: conn_dst-id = 0x14, pid = 216, 
pid name = systemd-cgroups, tid = 216, tid name = systemd-cgroups
30[3.634008@2] systemd-cgroups-agent[216]: Lch-Sent message type=signal 
sender=n/a destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cooki
e=1 reply_cookie=0 error=n/a
30[3.648452@0] systemd[1]: Lch-Got message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cookie
=0 error=n/a
6[3.650378@0] EXT4-fs (mmcblk0p9): re-mounted. Opts: (null)
6[3.652074@3] Lch-kdbus_bus_broadcast: conn_dst-id = 0x12, pid = 196, 
pid name = systemd-cgroups, tid = 196, tid name = systemd-cgroups
30[3.652220@3] systemd-cgroups-agent[196]: Lch-Sent message type=signal 
sender=n/a destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cooki
e=1 reply_cookie=0 error=n/a
6[3.652284@3] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[3.653329@3] systemd[1]: Lch-Sent message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a


30[3.654166@3] systemd[1]: Lch-Got message type=signal sender=:1.20 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
6[3.654642@3] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[3.654784@3] systemd[1]: Lch-Sent message type=signal sender=:1.20 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cook
ie=0 error=n/a
30[3.654958@3] systemd[1]: Lch-Got message type=signal sender=:1.18 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
...


6[  809.109334@1] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[  809.109397@1] systemd[1]: Lch-Sent message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
30[  809.109481@1] systemd[1]: Lch-Got message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cookie
=0 error=n/a
6[  809.109726@1] Lch-kdbus_bus_broadcast: conn_dst-id = 0x2, pid = 1, pid 
name = systemd, tid = 1, tid name = systemd
30[  809.109789@1] systemd[1]: Lch-Sent message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cooki
e=0 error=n/a
30[  809.109872@1] systemd[1]: Lch-Got message type=signal sender=:1.2 
destination=n/a object=/org/freedesktop/systemd1/agent 
interface=org.freedesktop.systemd1.Agent member=Released cookie=1 reply_cookie
=0 error=n/a






Thanks!
Li Cheng



At 2015-06-17 14:11:11, eshark eshar...@163.com wrote:

Hi,
   I'm so sorry for not giving you more details,  I'm a freshman here, but I'll 
try to do better in the future.
I will give the answers under each of the questions .

At 2015-06-16 18:54:23, David Herrmann dh.herrm...@gmail.com wrote:
Hi

On Tue, Jun 16, 2015 at 12:07 PM, eshark eshar...@163.com wrote:
 At 2015-06-16 15:54:10, David Herrmann dh.herrm...@gmail.com wrote:
Can you be more specific, please? What do you mean by network module
of our systemd cannot work OK?



Does this only happen with kdbus?
Yes.  It's OK with DBus.
Does this only happen with you kdbus-patch to make broadcasts being
sent to oneself?
Yes. Without modifying kdbus_bus_broadcast(),  I can always get the ip.
Or does it happen with unmodified kdbus, too?
Never.
What exactly changes?
I just commented out the following two lines in the 

Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-16 Thread eshark
Hi,


At 2015-06-15 22:32:27, Lennart Poettering lenn...@poettering.net wrote:
On Mon, 15.06.15 19:05, eshark (eshar...@163.com) wrote:

 Hi, All,
If I post this email to the wrong mail-list, please tell me, thank 
 you.
 
Now many JS applications implement the client and service in the same 
 thread, so they share the same connection too.
 
 However when the client or the service want to send signal to the other,  
 the receiver cannot get the signal because the kdbus driver 
 
 won't broadcast the signal to the source connection.
 
   I've tried to simply allow the kdbus driver to send signal to all the 
 connections including the source , but it seems not work OK.
 
 I wonder that how I can make kdbus send signal to the source connection, or 
 that this is impossible ?

I am not dure I follow. Are you developing a native kdbus client

library for JS? 
Yes, we already have a library based on DBus, and I'm migrating it to KDBus.



Did I get this right, you have one bus connection per thread, but
possibly both a kdbus client and its service run from the server, and
you want broadcast msgs sent out from one to then also be matchable by

the other?
Yes.  And I've tried removing the condition in kdbus_bus_broadcast(), as David  
said. 
But this modification caused that the network module of our system cannot work 
OK,  it's very strange ,
and I'm not familiar with the network module, so I  haven't find the root 
cause. 
Maybe it has nothing to do with KDBus? I am not sure.



Can't you dispatch that locally? i.e. in addition to passing the msg
to kdbus also enqueue it locallly along the kdbus fd, or so?

But I am not sure I understand the problem fully...

Lennart

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


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-16 Thread David Herrmann
Hi

On Tue, Jun 16, 2015 at 9:35 AM, eshark eshar...@163.com wrote:
 Hi,


 At 2015-06-15 22:32:27, Lennart Poettering lenn...@poettering.net wrote:
On Mon, 15.06.15 19:05, eshark (eshar...@163.com) wrote:

 Hi, All,
If I post this email to the wrong mail-list, please tell me, thank
 you.

Now many JS applications implement the client and service in the
 same thread, so they share the same connection too.

 However when the client or the service want to send signal to the other,
 the receiver cannot get the signal because the kdbus driver

 won't broadcast the signal to the source connection.

   I've tried to simply allow the kdbus driver to send signal to all
 the connections including the source , but it seems not work OK.

 I wonder that how I can make kdbus send signal to the source connection,
 or that this is impossible ?

I am not dure I follow. Are you developing a native kdbus client
library for JS?
 Yes, we already have a library based on DBus, and I'm migrating it to KDBus.


Did I get this right, you have one bus connection per thread, but
possibly both a kdbus client and its service run from the server, and
you want broadcast msgs sent out from one to then also be matchable by
the other?
 Yes.  And I've tried removing the condition in kdbus_bus_broadcast(), as
 David  said.
 But this modification caused that the network module of our system cannot
 work OK,  it's very strange ,
 and I'm not familiar with the network module, so I  haven't find the root
 cause.
 Maybe it has nothing to do with KDBus? I am not sure.

Can you be more specific, please? What do you mean by network module
of our systemd cannot work OK?

Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-16 Thread David Herrmann
Hi

On Tue, Jun 16, 2015 at 12:07 PM, eshark eshar...@163.com wrote:
 At 2015-06-16 15:54:10, David Herrmann dh.herrm...@gmail.com wrote:
Can you be more specific, please? What do you mean by network module
of our systemd cannot work OK?

 Sorry.  Acctually  our network module cannot get ip by DHCP.  Our network
 module is
 connman, which depends on libdbus.And the connman will connect to KDBus
 through the bus-proxyd, which is implemented in the libsystemd.

Can you please be more specific!

Does this only happen with kdbus?
Does this only happen with you kdbus-patch to make broadcasts being
sent to oneself?
Or does it happen with unmodified kdbus, too?
What exactly changes?
Does everything work perfectly well without kdbus?
Is the missing DHCP connectivity the only difference you see with kdbus?
What kdbus version do you run?
What kdbus tree do you use?
What systemd version do you use? (in case of git: which commit?)
Did you pass --enable-kdbus to systemd?
What upstream kernel version do you use?
Any obscure messages in the system-log that you didn't see before?
...

Please try to paste as much information as possible. Otherwise, it's
really a hassle to ask for each piece of information separately.

Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-16 Thread eshark
Hi,


At 2015-06-16 15:54:10, David Herrmann dh.herrm...@gmail.com wrote:
Hi

On Tue, Jun 16, 2015 at 9:35 AM, eshark eshar...@163.com wrote:
 Hi,


 At 2015-06-15 22:32:27, Lennart Poettering lenn...@poettering.net wrote:
On Mon, 15.06.15 19:05, eshark (eshar...@163.com) wrote:

 Hi, All,
If I post this email to the wrong mail-list, please tell me, thank
 you.

Now many JS applications implement the client and service in the
 same thread, so they share the same connection too.

 However when the client or the service want to send signal to the other,
 the receiver cannot get the signal because the kdbus driver

 won't broadcast the signal to the source connection.

   I've tried to simply allow the kdbus driver to send signal to all
 the connections including the source , but it seems not work OK.

 I wonder that how I can make kdbus send signal to the source connection,
 or that this is impossible ?

I am not dure I follow. Are you developing a native kdbus client
library for JS?
 Yes, we already have a library based on DBus, and I'm migrating it to KDBus.


Did I get this right, you have one bus connection per thread, but
possibly both a kdbus client and its service run from the server, and
you want broadcast msgs sent out from one to then also be matchable by
the other?
 Yes.  And I've tried removing the condition in kdbus_bus_broadcast(), as
 David  said.
 But this modification caused that the network module of our system cannot
 work OK,  it's very strange ,
 and I'm not familiar with the network module, so I  haven't find the root
 cause.
 Maybe it has nothing to do with KDBus? I am not sure.

Can you be more specific, please? What do you mean by network module

of our systemd cannot work OK?


Sorry.  Acctually  our network module cannot get ip by DHCP.  Our network 
module is
connman, which depends on libdbus.And the connman will connect to KDBus 
through the bus-proxyd, which is implemented in the libsystemd.


I have not traced into connman , so I'm not very clear about the root cause.


Thanks !


Li Cheng



Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Can kdbus send signal to the source connection?

2015-06-15 Thread eshark
Hi, All,
   If I post this email to the wrong mail-list, please tell me, thank you.

   Now many JS applications implement the client and service in the same 
thread, so they share the same connection too.

However when the client or the service want to send signal to the other,  the 
receiver cannot get the signal because the kdbus driver 

won't broadcast the signal to the source connection.

  I've tried to simply allow the kdbus driver to send signal to all the 
connections including the source , but it seems not work OK.

I wonder that how I can make kdbus send signal to the source connection, or 
that this is impossible ?

Thanks a lot !


Best Regards,

Li Cheng 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-15 Thread David Herrmann
Hi

On Mon, Jun 15, 2015 at 4:43 PM, Simon McVittie
simon.mcvit...@collabora.co.uk wrote:
 On 15/06/15 15:32, Lennart Poettering wrote:
 Did I get this right, you have one bus connection per thread, but
 possibly both a kdbus client and its service run from the server, and
 you want broadcast msgs sent out from one to then also be matchable by
 the other?

 If this is indeed what eshark means, then talking to yourself like
 this is something that always used to work with traditional D-Bus (as
 long as you make sure to never block waiting for a reply!), so it's a
 regression if it doesn't work with kdbus.

 In traditional D-Bus, broadcasts go to any connection that has
 registered its interest in the broadcast via AddMatch. dbus-daemon does
 not discriminate between the sender of a message, and other connections
 - in particular, it will send a copy of a broadcast back to its sender,
 if that's what the sender asked for.

 Various projects' regression tests work like this: they run the
 client-side and service-side code in the same GLib main loop and do
 everything asynchronously, and it works. Ideally, the only processes
 involved are the test and the dbus-daemon (and under kdbus the
 dbus-daemon would not be needed either).

Didn't know traditional DBus allows this. The kdbus fix should be as
simple as removing the condition in kdbus_bus_broadcast(). Dead-lock
detection for src==dst is already in place, as we allow unicasts to
oneself.

I'll look into this.

Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-15 Thread Lennart Poettering
On Mon, 15.06.15 19:05, eshark (eshar...@163.com) wrote:

 Hi, All,
If I post this email to the wrong mail-list, please tell me, thank you.
 
Now many JS applications implement the client and service in the same 
 thread, so they share the same connection too.
 
 However when the client or the service want to send signal to the other,  the 
 receiver cannot get the signal because the kdbus driver 
 
 won't broadcast the signal to the source connection.
 
   I've tried to simply allow the kdbus driver to send signal to all the 
 connections including the source , but it seems not work OK.
 
 I wonder that how I can make kdbus send signal to the source connection, or 
 that this is impossible ?

I am not dure I follow. Are you developing a native kdbus client
library for JS? 

Did I get this right, you have one bus connection per thread, but
possibly both a kdbus client and its service run from the server, and
you want broadcast msgs sent out from one to then also be matchable by
the other?

Can't you dispatch that locally? i.e. in addition to passing the msg
to kdbus also enqueue it locallly along the kdbus fd, or so?

But I am not sure I understand the problem fully...

Lennart

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


Re: [systemd-devel] Can kdbus send signal to the source connection?

2015-06-15 Thread Simon McVittie
On 15/06/15 15:32, Lennart Poettering wrote:
 Did I get this right, you have one bus connection per thread, but
 possibly both a kdbus client and its service run from the server, and
 you want broadcast msgs sent out from one to then also be matchable by
 the other?

If this is indeed what eshark means, then talking to yourself like
this is something that always used to work with traditional D-Bus (as
long as you make sure to never block waiting for a reply!), so it's a
regression if it doesn't work with kdbus.

In traditional D-Bus, broadcasts go to any connection that has
registered its interest in the broadcast via AddMatch. dbus-daemon does
not discriminate between the sender of a message, and other connections
- in particular, it will send a copy of a broadcast back to its sender,
if that's what the sender asked for.

Various projects' regression tests work like this: they run the
client-side and service-side code in the same GLib main loop and do
everything asynchronously, and it works. Ideally, the only processes
involved are the test and the dbus-daemon (and under kdbus the
dbus-daemon would not be needed either).

 Can't you dispatch that locally? i.e. in addition to passing the msg
 to kdbus also enqueue it locallly along the kdbus fd, or so?

That would mean re-ordering the broadcast messages (taking them out of
their correct sequence relative to other messages), which is one of the
reasons why traditional D-Bus implementations don't optimize messages
to yourself in this way. One of dbus-daemon's roles is to impose a
total ordering on messages - it's the component that makes the arbitrary
decision on how the individual message streams get interleaved.

-- 
Simon McVittie
Collabora Ltd. http://www.collabora.com/

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel