From 0ba47396840dafad7e131e21cdd52cb1c3ed8e9a Mon Sep 17 00:00:00 2001 From: zhangliu <1807346727@qq.com> Date: Fri, 5 Jul 2024 10:08:55 +0800 Subject: [PATCH] fix pyinstaller produce too many MEI files cause /tmp capacity over --- rpm/remove_pyinstaller_MEI.sh | 13 +++++++++++++ rpm/sysak_iomonitor.service | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 rpm/remove_pyinstaller_MEI.sh create mode 100644 rpm/sysak_iomonitor.service diff --git a/rpm/remove_pyinstaller_MEI.sh b/rpm/remove_pyinstaller_MEI.sh new file mode 100644 index 00000000..5939d020 --- /dev/null +++ b/rpm/remove_pyinstaller_MEI.sh @@ -0,0 +1,13 @@ +#!/bin/bash +echo -e "CleanUpMEI begin..." +num=`/bin/ls /tmp | /bin/grep "MEI" | /usr/bin/wc -l` + +/usr/bin/cd /tmp && /bin/ls /tmp | /bin/grep "MEI" | /usr/bin/xargs -I {} /bin/rm -rf /tmp/{} + +if (/bin/ls /tmp | /bin/grep "MEI"); then + echo -e "Delete _MEI failed" +else + echo -e "Delete _MEI success" + echo "delete $num MEI data" +fi +echo -e "CleanUpMEI over..." diff --git a/rpm/sysak_iomonitor.service b/rpm/sysak_iomonitor.service new file mode 100644 index 00000000..fa5a851e --- /dev/null +++ b/rpm/sysak_iomonitor.service @@ -0,0 +1,15 @@ +[Unit] + Description=sysak iomonitor + After=unity.target + +[Service] + Type=simple + Restart=always + RestartSec=10 + CPUQuota=20% + MemoryLimit=700M + ExecStartPre=/bin/bash /usr/local/sysak/.sysak_components/tools/remove_pyinstaller_MEI.sh + ExecStart=/bin/sysak ioMonitor -s "await=100,iowait=15,util=85,iops=900,bps=524288000,diagIowait=on,diagIoburst=on,diagIolat=on" -y /etc/sysak/base.yaml + ExecStop=kill -9 $(pidof ioMonitor) + ExecReload=kill -1 $(pidof ioMonitor) + TimeoutStopSec=30s -- Gitee