Use working directory in diagnostic to detect ports in use
Overview
In the PortInUse diagnostic (Port required by GDK is already in use), we use ps -p #{pid} -o args= to get the process name to check if a port is used by an application outside of GDK. It does so by checking if the process name includes the GDK root directory name.
This can create false positives with Nginx or Zoekt because the process name of nginx workers and zoekt does not include the GDK working directory path.
Impacted categories
The following categories relate to this issue:
- 
gdk-reliability - e.g. When a GDK action fails to complete. 
- 
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. 
- 
gdk-performance - e.g. When a GDK action is slow or times out. 
Impact
- User confusion: during troubleshooting, a false-positive of this diagnostic will likely lead to wasted time investigating this red herring.
Implementation plan
Improve the PortInUse diagnostic by checking that the working directory contains the GDK root directory:
lsof -a -d cwd -p $PIDWe can either:
- completely switch over to this strategy (thus not allowing any GDK process outside of the GDK root directory) or
- require that the GDK root directory must appear in the process name or working directory.
Edited  by Kev Kloss