From 284ff94c8b5a6bbf4213a99caaa2f8b083c0d236 Mon Sep 17 00:00:00 2001 From: zhuofeng Date: Sat, 14 Sep 2024 09:45:31 +0800 Subject: [PATCH] fix syssentry fails to be started when cpu_sentry is not installed --- ...ils-to-be-started-when-cpu_sentry-is.patch | 56 +++++++++++++++++++ sysSentry.spec | 9 ++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 fix-syssentry-fails-to-be-started-when-cpu_sentry-is.patch diff --git a/fix-syssentry-fails-to-be-started-when-cpu_sentry-is.patch b/fix-syssentry-fails-to-be-started-when-cpu_sentry-is.patch new file mode 100644 index 0000000..675277f --- /dev/null +++ b/fix-syssentry-fails-to-be-started-when-cpu_sentry-is.patch @@ -0,0 +1,56 @@ +From 497b3124f017ce4ae99b34261c4fd5dd2a358f5b Mon Sep 17 00:00:00 2001 +From: zhuofeng +Date: Sat, 14 Sep 2024 09:28:00 +0800 +Subject: [PATCH] fix syssentry fails to be started when cpu_sentry is not + installed + +--- + src/python/syssentry/syssentry.py | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/python/syssentry/syssentry.py b/src/python/syssentry/syssentry.py +index f93956e..776971f 100644 +--- a/src/python/syssentry/syssentry.py ++++ b/src/python/syssentry/syssentry.py +@@ -43,7 +43,6 @@ try: + from .cpu_alarm import cpu_alarm_recv + except ImportError: + CPU_EXIST = False +- logging.debug("Cannot find cpu sentry mod") + + + INSPECTOR = None +@@ -563,20 +562,21 @@ def main(): + if not os.path.exists(SENTRY_RUN_DIR): + os.mkdir(SENTRY_RUN_DIR) + os.chmod(SENTRY_RUN_DIR, mode=SENTRY_RUN_DIR_PERM) +- if not chk_and_set_pidfile(): +- logging.error("get pid file lock failed, exist") +- sys.exit(17) + + logging.basicConfig(filename=SYSSENTRY_LOG_FILE, level=logging.INFO) + os.chmod(SYSSENTRY_LOG_FILE, 0o600) + ++ if not chk_and_set_pidfile(): ++ logging.error("get pid file lock failed, exist") ++ sys.exit(17) ++ + try: + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + signal.signal(signal.SIGHUP, sig_handler) + signal.signal(signal.SIGCHLD, sigchld_handler) + +- logging.debug("finish main parse_args") ++ logging.info("finish main parse_args") + + _ = SentryConfig.init_param() + TasksMap.init_task_map() +@@ -587,3 +587,4 @@ def main(): + logging.error('%s', traceback.format_exc()) + finally: + release_pidfile() ++ +-- +2.33.0 + diff --git a/sysSentry.spec b/sysSentry.spec index beea5be..3ec61d0 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 11 +Release: 12 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -21,6 +21,7 @@ Patch8: add-deleted-code-to-plugin-rasdaemon.patch Patch9: Remove-ANSI-escape-sequences.patch Patch10: split-cpu_sentry-and-syssentry.patch Patch11: fix-configparser.InterpolationSyntaxError.patch +Patch12: fix-syssentry-fails-to-be-started-when-cpu_sentry-is.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -178,6 +179,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/syssentry/cpu_* %changelog +* Sat Sep 14 2024 zhuofeng - 1.0.2-12 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix syssentry fails to be started when cpu_sentry is not installed + * Wed Sep 11 2024 shixuantong - 1.0.2-11 - Type:bugfix - CVE:NA -- Gitee