<div dir="ltr"><div><div><div><div><div><div><div>Hi, <br><br></div>First off, thank you Mario for the great documentation for installing freeswitch on Mac OS X. It was very helpful. <br><br>I ran into a problem starting freeswitch locally on my mac. The problem was port 8021 was in use (default event_socket port). I had some misdirections figuring out what was using 8021 so I thought I'd write up a few notes with my experience (I've included the stupid things I did hoping others can learn from it) and maybe they can be posted on wiki in the trouble shooting section (or maybe they are already and I missed it :) ). <br>
<br>The first thing I did was run netstat: <br></div><br>netstat -an | grep 8021<br><br></div><div>output: <br><br>tcp6 0 0 fe80::1%lo0.8021 *.* LISTEN <br>tcp4 0 0 127.0.0.1.8021 *.* LISTEN <br>
tcp6 0 0 ::1.8021 *.* LISTEN <br></div><div><br>and see that yes, something else was using port 8021. But how do I get the PID? Got to love stackoverflow: <br><br><a href="http://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x">http://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x</a><br>
<br>sudo lsof -iTCP:8021 -sTCP:LISTEN <br><br></div>I ran that to find it's launchd, output: <br></div><br>COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME<br>launchd 1 root 83u IPv6 0x6977044a72cceb65 0t0 TCP localhost:intu-ec-client (LISTEN)<br>
launchd 1 root 84u IPv4 0x6977044a74952245 0t0 TCP localhost:intu-ec-client (LISTEN)<br>launchd 1 root 85u IPv6 0x6977044a72cce785 0t0 TCP localhost:intu-ec-client (LISTEN)<br><br></div>here's where my big detour started. I wondered, what is intu-ec-client? Well, if you google it, you'll find the first several hits are people saying their ios devices have been hacked. So I thought, oh ****, my laptop has been hacked (though it's OS X 10.8.5, not ios). I poked around some more, ran a complete virus checker, a lot more googling... <br>
<br></div>What I've finally concluded is the only reason intu-ec-client is listed there is because 8021 is registered with IANA as the default port for some intuit protocol and lsof is doing port number to name conversion. Turns out -P is used in lsof to not convert port numbers, -n is only for not converting address. <br>
<br></div><div>Once I decided my system was probably not hacked, and it's just a coincidence with the intu-ec-client port, I set out to figure out what really is using that port. I'm not a systems expert by any stretch so others reading this might think, what a dumbass, why didn't you do that in the first place. <br>
<br></div><div>Though considering it's launchd, with PID 1 and user root using that port, I guess I panicked thinking I'd better get this resolved while my system is still working...<br><br></div><div>Anyway, after googling around some more and learning something about launchd, I tried to telnet to the port (another suggestion from stackoverflow which in hind sight I should have done immediately) to see what was running there. I found there's an ftp-proxy running there. <br>
<br></div><div>Okay, so why is there an ftp-proxy running there? I've been running FS on this laptop for several weeks and haven't run into this before. <br><br>I checked all the programs that start automatically and removed some that I thought might possibly be starting an ftp-proxy (though I couldn't imagine why they would be). Rebooted and still there's that ftp-proxy. I guess, again in hindsight, none of those would have launched as root via launchd. <br>
<br></div><div>From the launchd man page, I found the configurations are in: <br><br> ~/Library/LaunchAgents Per-user agents provided by the user.<br> /Library/LaunchAgents Per-user agents provided by the administrator.<br>
/Library/LaunchDaemons System-wide daemons provided by the administrator.<br> /System/Library/LaunchAgents Per-user agents provided by Mac OS X.<br> /System/Library/LaunchDaemons System-wide daemons provided by Mac OS X.<br>
<br></div><div>And from that I found the ftp-proxy in: <br><br>/System/Library/LaunchDaemons/com.apple.ftp-proxy.plist <br><br>which, sure enough, has localhost and 8021 defined as a listener. <br><br></div><div>What I'm still wondering is why I hadn't hit that before. In the last few weeks, I haven't added an ftp-proxy. And that ftp-proxy.plist file is dated July, 2012. I did recently launch the apple installed version of apache on my laptop. I'm suspicious that also added the ftp-proxy to launchd. I probably should look into that but for now, I'm comfortable my system has not been hacked, I understand why that port is in use so I'll just change the setting in event_socket.conf.xml and get back to work :) <br>
<br>thanks, <br></div><div>Joel<br><br></div><div><br><br></div><div><div><div><div><br><br></div></div></div></div></div>