[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [nyx/master] Fix lsof line detection for usage of ports



commit df9cd999121272effe4323964559981260e7d6bb
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Sep 24 12:28:12 2017 -0700

    Fix lsof line detection for usage of ports
    
    My relay complains with...
    
      19:13:35 [NYX_INFO] Failed three attempts to determine the process using
      active ports (unrecognized output from lsof (lines are expected to have ten
      fields: COMMAND PID   USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME): COMMAND
      PID   USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME)
    
    This is because there's a single space after 'COMMAND' rather than two, causing
    us not to omit the title line from parsing. Making this less strict.
---
 nyx/tracker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nyx/tracker.py b/nyx/tracker.py
index 5d0d1fd..1fbd80e 100644
--- a/nyx/tracker.py
+++ b/nyx/tracker.py
@@ -337,7 +337,7 @@ def _process_for_ports(local_ports, remote_ports):
   if lsof_call:
     results = {}
 
-    if lsof_call[0].startswith('COMMAND  '):
+    if lsof_call[0].startswith('COMMAND'):
       lsof_call = lsof_call[1:]  # strip the title line
 
     for line in lsof_call:

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits