I have a process running in cygwin and using a port. When I kill the process in another cygwin window by issuing command:
kill -9 PID or /bin/kill -f PID
I can see the process got terminated. However, the port is not released. Usually I can terminate the process cleanly by using ctrl-c. Is there a kill command that can have the same effect as ctrl-c in cygwin? Thanks!
Best Answer
kill -9
should only be used as a last resort. Ifkill -SIGNINT PID
isn't doing what you want, trykill -SIGTERM PID
. These signals can be trapped by the application and it can do what it wants with them including performing cleanup or ignoring them.