Observations, Musings & Gadgets

...things I find interesting

Articles tagged with macosx

Finding the process that is using a port in Mac OSX

Here's the scenario. Our Mac OSX labs have this really annoying problem where they throw up a proxy authentication dialog even before you've logged on. Tracking down which process was causing these was not as simple as you might think.

We could see, using netstat, a connection being made to our proxy server after you completed the authentication, but unfortunately, netstat on Mac OSX does not have a -p or -b flag (linux and windows, respectively) to show which executable is using the port.

Luckily, there is another way

macdesktop:~ root# lsof -i

This will give you a list of open files, the -i flag nominating "internet" files. We simply looked for the process ID of any files that pertained to our proxy server and then used ps to get more info.

In this case it was SubmitDiagInfo. A process that can send diagnostic information to Apple. Here's the weird part though, you can tell it not to send the information, and it still authenticates against the proxy even though it doesn't actually create a connection to anywhere.

Fantastic. I think my collegue had to disable the service to get it to stop.

tagged as macosx

Archives