Can we block or drop a special dbus connection?

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Feb 2 02:57:18 PST 2015


On 02/02/15 07:29, WaLyong Cho wrote:
> A process has a dbus connection. And this process was gone to
> unreasonable state by any reason. And the other system daemon or
> itself(who the owner of the connection) notify to dbus daemon about this
> connection is not reachable now. So any message should be dropped. Then
> dbus daemon will drop any messages to the connection.

So... you want an IPC call that will create a denial of service
on-demand? :-)

What is your use-case here? Why would you want to do this?

> Does dbus already have this functionality? or similar?

The process owning the connection can stop receiving messages by
disconnecting from D-Bus. (You will need to turn off exit-on-disconnect
first, so that libdbus doesn't call _exit() when disconnection succeeds,
or so that GDBus doesn't call raise(SIGTERM).)

Other processes cannot do that, except by killing the owner of the
problematic connection, or taking control over it with ptrace or similar.

If this is intended as a way to stop a buggy process from using
resources, I would suggest just killing it with SIGTERM (or SIGKILL). If
not, you'll need to explain what you want before I can suggest a good
way to achieve it.

    S



More information about the dbus mailing list