Score:0

How to find the listener

jp flag

I have created a services that should listen on port 50051, but is is already in use.

So I need to find and kill the listener?

Step 1:

sudo lsof -i tcp:50051                                                                                                                                                                                                  
Password:
COMMAND PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
launchd   1 root   43u  IPv6 0x9cf985f50f0e6545      0t0  TCP *:50051 (LISTEN)
launchd   1 root   44u  IPv4 0x9cf985f50cb5056d      0t0  TCP *:50051 (LISTEN)

Step 2:

find ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons /System/Library/LaunchAgents /System/Library/LaunchDaemons -name "*.plist" -exec defaults read "{}" 2>/dev/null \; | grep --with-filename 50051
(standard input):            SockServiceName = 50051;

Step 3: ?

Note: I am unable to kill the listener as it is started by launchd.

lsof -ti tcp:500051 | xargs kill
Score:0
jp flag

This one did the trick

find ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons /System/Library/LaunchAgents /System/Library/LaunchDaemons -name "*.plist" -exec grep -H 50051 "{}" \; 2>/dev/null
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.