How to identify what processes are consuming dbus sockets?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6

Issue

  • Running number of GUI session on system through Xvnc causes dbus system daemon to run out of file descriptors.
  • Is there any way to identify what all processes are consuming dbus sockets on the system?

Resolution

  • Below command can be used to list approximate count of sockets opened for dbus system daemon
lsof -u dbus | grep -i socket | wc -l
  • dbus-send query can be used to list responsible processes
  • Command to list clients:
dbus-send --system --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames
  • Use below to get associated PID:
 dbus-send --system --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetConnectionUnixProcessID 'string::1.10'
  • This can be scripted to get list of all processes.
  • Run attached script as root for this.
  • In case dbus daemon is falling short of FDs, open files limit for dbus daemon can be raised by adding ulimit -n value in its init script.

Disclaimer:
Attached script is provided as-is and is not supported by Red Hat.

Attachments

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments