File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ use rand::Rng;
167
167
168
168
use std:: default:: Default ;
169
169
use std:: net:: ToSocketAddrs ;
170
+ use std:: process:: Command ;
170
171
use std:: sync:: { Arc , Mutex , RwLock } ;
171
172
use std:: time:: { Duration , Instant , SystemTime , UNIX_EPOCH } ;
172
173
@@ -333,6 +334,22 @@ impl Node {
333
334
listeners. push ( listener) ;
334
335
} ,
335
336
Err ( e) => {
337
+ println ! ( "Failed to bind to port {}" , addr) ;
338
+
339
+ let output = Command :: new ( "lsof" )
340
+ . args ( & [ "-i" , & format ! ( ":{}" , & addr. port( ) ) ] )
341
+ . output ( )
342
+ . expect ( "failed to execute lsof" ) ;
343
+
344
+ println ! ( "LSOF output: {}" , String :: from_utf8_lossy( & output. stdout) ) ;
345
+
346
+ let output = Command :: new ( "netstat" )
347
+ . args ( & [ "-an" ] )
348
+ . output ( )
349
+ . expect ( "failed to execute netstat" ) ;
350
+
351
+ println ! ( "Netstat output: {}" , String :: from_utf8_lossy( & output. stdout) ) ;
352
+
336
353
log_error ! (
337
354
logger,
338
355
"Failed to bind to {}: {} - is something else already listening?" ,
You can’t perform that action at this time.
0 commit comments