2

(On OS X 10.11.3) I'm having a problem starting a java process that needs to listen on port 8040. Getting a BindException. So seems like somebody else is already listening on it. A quick check confirms that:

lsof -i TCP| fgrep LISTEN | grep 8040
jspawnhel 13566 alon  255u  IPv6 0x2a5edc8fe0a093d7      0t0  TCP *:8040 (LISTEN)
jspawnhel 14482 alon  255u  IPv6 0x2a5edc8fe0a093d7      0t0  TCP *:8040 (LISTEN)
jspawnhel 81770 alon  255u  IPv6 0x2a5edc8fe0a093d7      0t0  TCP *:8040 (LISTEN)

So, I'm trying to figure out what these processes are, but I don't understand what ps is showing me:

ps ax | grep "13566\|14482\|81770"
13566   ??  U      0:00.00 313:316
14482   ??  U      0:00.00 324:327
81770   ??  U      0:00.00 301:304

what does the "??" mean? what is 313:316 in this context?

I can't kill it either, even with -9:

kill -9 13566
ps ax | grep 13566
13566   ??  U      0:00.00 313:316

Tried many times...

Any help is appreciated.

3

If you run ps ax without the grep, you'll see the column headers:

PID   TT  STAT      TIME COMMAND

?? is in the TT column -- that's the controlling terminal for the process. The ?? indicates that the process isn't associated with a terminal.

The U in the STAT column indicates that the process is in the uninterruptible sleep state. That explains why you cannot kill it -- is blocked in an uninterruptible sleep in the kernel and cannot be awoken to be terminated. When the process eventually exits the uninterruptible state, it will notice the signal and die.

The numbers in the right are in the COMMAND column -- that's the name of the process. As for what those processes are, I don't know.

  • 1
    And if you replace grep 8040 with sed -n '1p;/8040/p' you can keep the headers while you grep. – Wildcard Apr 5 '16 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.