From 7aa6524c83ff289c53207cf6e7f748f70c49e279 Mon Sep 17 00:00:00 2001 From: wangjun Date: Mon, 28 Aug 2023 12:09:52 +0800 Subject: [PATCH] [Huawei]rsyslog: adapt for non-systemd image Offering: RTOS Type: bugfix reason: adapt for non-systemd image Signed-off-by: wangjun --- adapt-for-non-systemd-image.patch | 49 +++++++++++++++++++++++++++++++ rsyslog.spec | 11 +++++-- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 adapt-for-non-systemd-image.patch diff --git a/adapt-for-non-systemd-image.patch b/adapt-for-non-systemd-image.patch new file mode 100644 index 0000000..c31d8a4 --- /dev/null +++ b/adapt-for-non-systemd-image.patch @@ -0,0 +1,49 @@ +From 03d7db92f7547d200949c7a11bede81078f3c6ae Mon Sep 17 00:00:00 2001 +From: Xin Shi +Date: Mon, 28 Aug 2023 11:19:53 +0800 +Subject: [PATCH] adapt for non-systemd image + + +diff --git a/runtime/queue.c b/runtime/queue.c +index a7684e5..41f2095 100644 +--- a/runtime/queue.c ++++ b/runtime/queue.c +@@ -2912,6 +2912,7 @@ finalize_it: + + void PrintQueueFullLog(qqueue_t *pThis, int flag) + { ++#ifdef HAVE_LIBSYSTEMD + struct timespec timeNow; + + clock_gettime(CLOCK_MONOTONIC, &timeNow); +@@ -2927,6 +2928,7 @@ void PrintQueueFullLog(qqueue_t *pThis, int flag) + } + g_lastTime.tv_sec = timeNow.tv_sec; + } ++#endif + } + + /* enqueue a single data object. +diff --git a/tools/rsyslogd.c b/tools/rsyslogd.c +index 8be2032..7e8c3a0 100644 +--- a/tools/rsyslogd.c ++++ b/tools/rsyslogd.c +@@ -2004,6 +2004,7 @@ mainloop(void) + if(need_free_mutex) { + pthread_mutex_unlock(&mutHadHUP); + } ++#ifdef HAVE_LIBSYSTEMD + if (g_bRecordQueue) { + if(runConf->pMsgQueue != NULL) { + sd_journal_print(LOG_NOTICE, "main queue size information: current QueueSize=%d MaxQueueSize=%d\n", +@@ -2013,6 +2014,7 @@ mainloop(void) + } + g_bRecordQueue = 0; + } ++#endif + + processImInternal(); + +-- +2.27.0 + diff --git a/rsyslog.spec b/rsyslog.spec index 273aa0f..f1cf33b 100644 --- a/rsyslog.spec +++ b/rsyslog.spec @@ -7,7 +7,7 @@ Name: rsyslog Version: 8.2210.0 -Release: 3 +Release: 4 Summary: The rocket-fast system for log processing License: (GPLv3+ and ASL 2.0) URL: http://www.rsyslog.com/ @@ -30,7 +30,8 @@ Patch9003: rsyslog-8.37.0-initialize-variables-and-check-return-value.patch Patch9004: print-main-queue-info-to-journal-when-queue-full.patch Patch9005: print-main-queue-info-to-journal-when-receive-USR1-signal.patch %endif - +Patch9006: adapt-for-non-systemd-image.patch + Patch6000: backport-core-bugfix-local-hostname-invalid-if-no-global-config-object-given.patch Patch6001: backport-imtcp-bugfix-legacy-config-directives-did-no-longer-work.patch Patch6002: backport-core-bugfix-template-system-may-generate-invalid-json.patch @@ -513,6 +514,12 @@ done %{_mandir}/man1/rscryutil.1.gz %changelog +* Mon Aug 28 2023 wangjun - 8.2210.0-4 +- Type:NA +- ID:NA +- SUG:NA +- DESC:adapt for non-systemd image + * Sun Jun 25 2023 linzhuorong - 8.2210.0-3 - Type:NA - ID:NA -- Gitee