Explorar el Código

Immediatelt delete the ipt log file after unrollling it in sqm_stop()

Currently the ipt log file is only trncated/deleted in sqm_start_default()
which is the latest sane position to delete the last log. But we solicit
that users can easily override sq_start_default() by supplying their own
sqm_start() function as part of their qos file, without mentioning that they
better call ipt_log_restart() as part of that script otherwise, we end up
with a constantly growing ipt log file.
As a belts and suspenders solution this commit adds a call to ipt_log_restart()
immediately after the ipt_log_rewind() in sqm_stop to delete the old log the moment
it becomes expendable.

Signed-off-by: Sebastian Moeller <moeller0@gmx.de>
Sebastian Moeller hace 5 años
padre
commit
50b979c58a
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      src/functions.sh

+ 2 - 0
src/functions.sh

@@ -509,6 +509,8 @@ sqm_stop() {
 
     # undo accumulated ipt commands during shutdown
     ipt_log_rewind
+    # reset the iptables trace log
+    ipt_log_restart
 
     [ -n "$CUR_IFB" ] && $IP link set dev ${CUR_IFB} down
     [ -n "$CUR_IFB" ] && $IP link delete ${CUR_IFB} type ifb