How to get tcp listen port

Joshua Swink joshua.swink at gmail.com
Mon Feb 25 12:52:02 PST 2008


How can I determine what TCP port dbus-daemon is listening on?

I have set my system dbus-daemon to listen on a system-selected port,
which it does. I can determine the port as root (e.g., sudo netstat
-ptl). But how can I get the port 1) with user privileges, and 2)
without rebooting?

My best current guess would be to modify the init script,
/etc/init.d/dbus, to use the "--print-address" option and to save the
output somewhere like /var/run/dbus/addresses. I was just wondering if
there is a better way.


More information about the dbus mailing list