From a21f730c2daa08feeb9bf23fb716a854da6ae694 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Wed, 2 Aug 2023 07:56:17 -0700 Subject: [PATCH] Better lsof to find process Summary: The previous recommendation doesn't always holds true. There are reported cases in which a process is listening to the specified port yet is not being listed by the lsof command as advised. The command below seems to work better. sudo lsof -i :52342 Reviewed By: antonk52 Differential Revision: D47989269 fbshipit-source-id: ea216de00ef6edc90de58e9d3fe3a0579a171fea --- desktop/flipper-server-client/src/FlipperServerClient.tsx | 2 +- desktop/flipper-ui-core/src/chrome/SettingsSheet.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/flipper-server-client/src/FlipperServerClient.tsx b/desktop/flipper-server-client/src/FlipperServerClient.tsx index 489fa7f70..834e91fce 100644 --- a/desktop/flipper-server-client/src/FlipperServerClient.tsx +++ b/desktop/flipper-server-client/src/FlipperServerClient.tsx @@ -50,7 +50,7 @@ export function createFlipperServerWithSocket( new Error( `Failed to connect to the server in a timely manner. It may be unresponsive. Run the following from the terminal - 'lsof -nP -iTCP -sTCP:LISTEN | grep 52342' and kill the listed process, if any.`, + 'sudo lsof -i :52342' and kill the listed process, if any.`, ), ); }, CONNECTION_TIMEOUT); diff --git a/desktop/flipper-ui-core/src/chrome/SettingsSheet.tsx b/desktop/flipper-ui-core/src/chrome/SettingsSheet.tsx index 5ab70a300..a47197347 100644 --- a/desktop/flipper-ui-core/src/chrome/SettingsSheet.tsx +++ b/desktop/flipper-ui-core/src/chrome/SettingsSheet.tsx @@ -433,7 +433,7 @@ class SettingsSheet extends Component {
- sudo lsof -i -P | grep LISTEN | grep 52342 + sudo lsof -i :52342
sudo kill <PID>