From 08df57bde39ddd60c02ec3001999a497974b8214 Mon Sep 17 00:00:00 2001 From: zhu-yuncheng Date: Mon, 11 Sep 2023 19:31:34 +0800 Subject: [PATCH] update vulcanus to 1.3.0-2 (cherry picked from commit 89813b1e324e3190adb9a0b46101bdedc0f65606) --- 0001-optimize-service-start-check-logic.patch | 43 +++++++++++++++++++ aops-vulcanus.spec | 10 +++-- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 0001-optimize-service-start-check-logic.patch diff --git a/0001-optimize-service-start-check-logic.patch b/0001-optimize-service-start-check-logic.patch new file mode 100644 index 0000000..98cea1d --- /dev/null +++ b/0001-optimize-service-start-check-logic.patch @@ -0,0 +1,43 @@ +From 2820dc579dad400c8b0f4dfe4220c3d78e218645 Mon Sep 17 00:00:00 2001 +From: gongzt +Date: Wed, 30 Aug 2023 15:41:06 +0800 +Subject: [PATCH] = Optimize start service check logic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + aops-vulcanus | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/aops-vulcanus b/aops-vulcanus +index abb02b1..ba854f9 100644 +--- a/aops-vulcanus ++++ b/aops-vulcanus +@@ -100,8 +100,13 @@ function is_started() { + function start_service() { + module_name=$1 + echo "[INFO] 1. Before starting the service, ensure that the data table is initialized" +- echo "[INFO] 2. Execute aops-basedatabase zeus or apollo to complete the data table initialization, For example '/opt/aops/script/aops-basedatabase init zues'" ++ echo "[INFO] 2. Execute aops-basedatabase zeus or apollo to complete the data table initialization, For example '/opt/aops/script/aops-basedatabase init zeus'" + uwsgi -d --ini ${OUT_PATH}/"${module_name}".ini --enable-threads ++ pid=`ps auxww | grep $module_name.ini | grep -v grep | awk '{print $2}'` ++ if [ "${pid}" = "" ]; then ++ echo "[ERROR] start uwsgi service: ${module_name} failed" ++ exit 1 ++ fi + echo "[INFO] start uwsgi service: ${module_name} success" + exit 0 + } +@@ -167,7 +172,7 @@ function check_mysql_installed() { + aops_database=$(get_config "$CONFIG_FILE" "mysql" "database_name") + connect_check_cmd="import pymysql + try: +- connect = pymysql.connect(host='$mysql_ip', port=$port, password='123456', database='$aops_database') ++ connect = pymysql.connect(host='$mysql_ip', port=$port, database='$aops_database') + connect.close() + except pymysql.err.OperationalError: + print(False) +-- +Gitee + diff --git a/aops-vulcanus.spec b/aops-vulcanus.spec index cee832d..2cc0946 100644 --- a/aops-vulcanus.spec +++ b/aops-vulcanus.spec @@ -1,11 +1,12 @@ Name: aops-vulcanus Version: v1.3.0 -Release: 1 +Release: 2 Summary: A basic tool libraries of aops, including logging, configure and response, etc. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} Source0: %{name}-%{version}.tar.gz - +Patch0001: 0001-optimize-service-start-check-logic.patch + BuildRequires: python3-setuptools Requires: python3-concurrent-log-handler python3-xmltodict python3-pyyaml python3-marshmallow >= 3.13.0 @@ -30,7 +31,7 @@ tools for aops, it's about aops deploy %prep -%autosetup -n %{name}-%{version} +%autosetup -n %{name}-%{version} -p1 # build for aops-vulcanus @@ -60,6 +61,9 @@ cp -r scripts %{buildroot}/opt/aops/ %changelog +* Mon Sep 11 2023 zhuyuncheng - v1.3.0-2 +- optimize start service check logic + * Tue Aug 29 2023 wenxin - v1.3.0-1 - optimize project directory structure - support database initialization script -- Gitee