From 97e0a6f86c8dd7c4871ebb91468a9f2630a3c9d2 Mon Sep 17 00:00:00 2001 From: zhuofeng <1107893276@qq.com> Date: Fri, 13 Dec 2024 09:40:26 +0000 Subject: [PATCH] change status of period task and sort mod file Signed-off-by: zhuofeng <1107893276@qq.com> --- ...tus-of-period-task-and-sort-mod-file.patch | 36 +++++++++++++++++++ sysSentry.spec | 13 ++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 change-status-of-period-task-and-sort-mod-file.patch diff --git a/change-status-of-period-task-and-sort-mod-file.patch b/change-status-of-period-task-and-sort-mod-file.patch new file mode 100644 index 0000000..12aab0e --- /dev/null +++ b/change-status-of-period-task-and-sort-mod-file.patch @@ -0,0 +1,36 @@ +From 8cc13a422ed29e48b0c5b86b2da2a5dc8ad4aa59 Mon Sep 17 00:00:00 2001 +From: zhuofeng +Date: Fri, 13 Dec 2024 11:20:55 +0800 +Subject: [PATCH] change status of period task and sort mod file + +--- + src/python/syssentry/cron_process.py | 1 + + src/python/syssentry/load_mods.py | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/python/syssentry/cron_process.py b/src/python/syssentry/cron_process.py +index 50780b3..5543d67 100644 +--- a/src/python/syssentry/cron_process.py ++++ b/src/python/syssentry/cron_process.py +@@ -144,6 +144,7 @@ def period_tasks_handle(): + + if not task.onstart: + logging.debug("period onstart not enabled, task: %s", task.name) ++ task.runtime_status = EXITED_STATUS + continue + + if task.runtime_status == WAITING_STATUS and \ +diff --git a/src/python/syssentry/load_mods.py b/src/python/syssentry/load_mods.py +index 48d7e66..5be5540 100644 +--- a/src/python/syssentry/load_mods.py ++++ b/src/python/syssentry/load_mods.py +@@ -224,6 +224,7 @@ def load_tasks(): + return "failed", "" + + mod_files = os.listdir(TASKS_STORAGE_PATH) ++ mod_files.sort() + for mod_file in mod_files: + logging.debug("find mod, path is %s", mod_file) + if not mod_file.endswith(MOD_FILE_SUFFIX): +-- +2.33.0 diff --git a/sysSentry.spec b/sysSentry.spec index a743e22..28db2f3 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 62 +Release: 63 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -84,6 +84,7 @@ Patch71: ai_block_io-fix-some-config-parameters-parse-bug.patch Patch72: update-nvme-config.patch Patch73: make-debug-msg-clear.patch Patch74: add-boundary-check-for-settings.patch +Patch75: change-status-of-period-task-and-sort-mod-file.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -206,6 +207,9 @@ install -d -m 700 %{buildroot}/etc/sysSentry/plugins/ install -m 600 config/inspect.conf %{buildroot}%{_sysconfdir}/sysSentry install -m 600 service/sysSentry.service %{buildroot}%{_unitdir} +# rasdaemon +install config/tasks/rasdaemon.mod %{buildroot}/etc/sysSentry/tasks/ + # xalarm sh build/build.sh -i %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d @@ -288,6 +292,7 @@ rm -rf %{buildroot} %attr(0750,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/tasks %attr(0750,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/plugins %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/inspect.conf +%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysSentry/tasks/rasdaemon.mod %attr(0600,root,root) %{_unitdir}/sysSentry.service # xalarm @@ -377,6 +382,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/syssentry/bmc_alarm.py %changelog +* Fri Dec 13 2024 zhuofeng - 1.0.2-63 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC: change status of period task and sort mod file + * Wed Nov 6 2024 luckky - 1.0.2-62 - Type:bugfix - CVE:NA -- Gitee