Can add and remove bw accounting without reboots.
[nodemanager.git] / bwmon.py
index 6f5c90e..8a9e96f 100644 (file)
--- a/bwmon.py
+++ b/bwmon.py
@@ -685,8 +685,10 @@ def run():
         nmdbcopy = copy.deepcopy(database.db)
         database.db_lock.release()
         try:  
-            if getDefaults(nmdbcopy): sync(nmdbcopy)
-            else: logger.log("bwmon:  DISABLED.")
+            if getDefaults(nmdbcopy) and len(bwlimit.tc("class show dev eth0")) > 0:
+                # class show to check if net:InitNodeLimit:bwlimit.init has run.
+                sync(nmdbcopy)
+            else: logger.log("bwmon:  BW limits DISABLED.")
         except: logger.log_exc()
         lock.clear()