@@ -62,10 +62,6 @@ S115_usermode_emulator() {
62
62
# ensure that the emulator does not reconfigure the interface
63
63
get_local_ip
64
64
65
- # some processes are running long and logging a lot
66
- # to protect the host we are going to kill them on a KILL_SIZE limit
67
- export KILL_SIZE=" 50M"
68
-
69
65
# load blacklist of binaries that could cause troubles during emulation:
70
66
readarray -t lBIN_BLACKLIST_ARR < " ${CONFIG_DIR} " /emulation_blacklist.cfg
71
67
@@ -720,14 +716,17 @@ emulate_binary() {
720
716
check_disk_space_emu () {
721
717
local lEMULATOR=" ${1:- } "
722
718
local lCRITICAL_FILES_ARR=()
723
- local lKILLER=" "
724
-
725
- mapfile -t lCRITICAL_FILES_ARR < <( find " ${LOG_PATH_MODULE} " / -xdev -type f -size +" ${KILL_SIZE} " -print0 2> /dev/null | xargs -r -0 -P 16 -I % sh -c ' basename % 2>/dev/null| cut -d\. -f1 | cut -d_ -f2' || true)
726
- for lKILLER in " ${lCRITICAL_FILES_ARR[@]} " ; do
727
- if pgrep -f " ${lEMULATOR} .*${lKILLER} " > /dev/null; then
719
+ local lKILL_PROC_NAME=" "
720
+
721
+ mapfile -t lCRITICAL_FILES_ARR < <( find " ${LOG_PATH_MODULE} " / -xdev -maxdepth 1 -type f -size +" ${QEMU_KILL_SIZE} " -print0 2> /dev/null | xargs -r -0 -P 16 -I % sh -c ' basename -s .txt % 2>/dev/null' || true)
722
+ for lKILL_PROC_NAME in " ${lCRITICAL_FILES_ARR[@]} " ; do
723
+ lKILL_PROC_NAME=" ${lKILL_PROC_NAME/ qemu_tmp_} "
724
+ lKILL_PROC_NAME=" ${lKILL_PROC_NAME/ qemu_initx_} "
725
+ lKILL_PROC_NAME=" ${lKILL_PROC_NAME/ stracer_} "
726
+ if pgrep -f " ${lEMULATOR} .*${lKILL_PROC_NAME} " > /dev/null; then
728
727
print_output " [!] Qemu processes are wasting disk space ... we try to kill it" " no_log"
729
- print_output " [*] Killing process ${ORANGE}${lEMULATOR} .*${lKILLER } .*${NC} " " no_log"
730
- pkill -f " ${lEMULATOR} .*${lKILLER } .*" > /dev/null|| true
728
+ print_output " [*] Killing process ${ORANGE}${lEMULATOR} .*${lKILL_PROC_NAME } .*${NC} " " no_log"
729
+ pkill -f " ${lEMULATOR} .*${lKILL_PROC_NAME } .*" > /dev/null|| true
731
730
# rm "${LOG_DIR}"/qemu_emulator/*"${lKILLER}"*
732
731
fi
733
732
done
0 commit comments