From e58ec68dcb509ba59e17c41d4d7c4f5849f457ab Mon Sep 17 00:00:00 2001 From: zhang_xubo <2578876417@qq.com> Date: Thu, 27 Jan 2022 14:50:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?sysctmctl=E6=8B=89=E8=B5=B7=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E4=B8=80=E4=BC=9A=E8=BF=9B=E7=A8=8B=E5=B0=B1=E8=87=AA?= =?UTF-8?q?=E8=A1=8C=E5=85=B3=E9=97=AD=E3=80=82=E6=B7=BB=E5=8A=A0RemainAft?= =?UTF-8?q?erExit=3Dyes=E4=BF=9D=E6=8C=81=E8=BF=9B=E7=A8=8B=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- opengauss-server.spec | 5 ++++- opengauss.service | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/opengauss-server.spec b/opengauss-server.spec index 906e712..d453708 100755 --- a/opengauss-server.spec +++ b/opengauss-server.spec @@ -12,7 +12,7 @@ Name: opengauss Version: 2.1.0 -Release: 3 +Release: 4 Summary: openGauss is an open source relational database management system License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0 URL: https://gitee.com/opengauss/openGauss-server @@ -288,6 +288,9 @@ fi %changelog +* Thur Jan 27 2022 zhangxubo - 2.1.0-4 +- Fix bugs: #I4SDWX + * Sat Jan 22 2022 zhangxubo - 2.1.0-3 - Fix bugs: #I4RVNX diff --git a/opengauss.service b/opengauss.service index e9f1f42..c2680b2 100755 --- a/opengauss.service +++ b/opengauss.service @@ -6,6 +6,7 @@ After=local-fs.target Type=idle ExecStart=/usr/local/opengauss/script/autostart.sh Delegate=yes +RemainAfterExit=yes [Install] WantedBy=multi-user.target -- Gitee From 993212a620dde752055ed6574aee269556a5d230 Mon Sep 17 00:00:00 2001 From: zhang_xubo <2578876417@qq.com> Date: Sat, 12 Mar 2022 19:20:06 +0800 Subject: [PATCH 2/3] Fixed ease of use issues (cherry picked from commit e77658c53bdf09c7ddf842e9bc2a6ee98ee8f1f4) --- opengauss-bashprofile | 4 +--- opengauss-server.spec | 32 ++++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/opengauss-bashprofile b/opengauss-bashprofile index b224447..0d44355 100644 --- a/opengauss-bashprofile +++ b/opengauss-bashprofile @@ -1,7 +1,5 @@ -[ -f /etc/profile ] && source /etc/profile - export GAUSSHOME=/usr/local/opengauss/ export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH export PATH=/usr/local/opengauss/bin:$PATH export PGDATA=/var/lib/opengauss/data -export PORT=7654 \ No newline at end of file +export PORT=7654 diff --git a/opengauss-server.spec b/opengauss-server.spec index d453708..f414ffd 100755 --- a/opengauss-server.spec +++ b/opengauss-server.spec @@ -12,7 +12,7 @@ Name: opengauss Version: 2.1.0 -Release: 4 +Release: 5 Summary: openGauss is an open source relational database management system License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0 URL: https://gitee.com/opengauss/openGauss-server @@ -184,15 +184,28 @@ install -m 644 %{SOURCE6} %{buildroot}/%{apppath}/script/opengauss.service install -m 700 %{SOURCE7} %{buildroot}/%{apppath}/script/autostart.sh %pre -/usr/sbin/groupadd -g 39 -o -r opengauss >/dev/null 2>&1 || : -/usr/sbin/useradd -M -N -g opengauss -o -r -d %{datapath} -s /bin/bash \ - -c "openGauss Server" -u 39 opengauss >/dev/null 2>&1 || : +/usr/sbin/groupadd opengauss >/dev/null 2>&1 || : +/usr/sbin/useradd -M -N -g opengauss -d %{datapath} -s /bin/bash \ + -c "openGauss Server" opengauss >/dev/null 2>&1 || : + +# for install step +if [ $1 = 1 ]; then + portinfo=$(lsof -i:%{port}) + if [ "${portinfo}" != "" ]; then + echo "The port[%{port}] is occupied. Please use command 'lsof -i:%{port} to check it.'" + exit 1 + fi +fi %post # set opengauss mini config parameters set_mini_configparam(){ config_mini_file=%{apppath}/share/postgresql/opengauss_config_file_mini + + # set guc parameters echo "port = %{port}" >> ${config_mini_file} + echo "synchronous_commit = off" >> ${config_mini_file} + echo "listen_addresses = '127.0.0.1'" >> ${config_mini_file} config_sample_file=%{apppath}/share/postgresql/postgresql.conf.sample if [[ -f $config_mini_file ]] @@ -227,13 +240,13 @@ start_opengauss(){ return 0 fi - result=`su - opengauss -c "source ~/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"` + result=`su - opengauss -c "source /var/lib/opengauss/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"` if [ $? -ne 0 ]; then echo "Init openGauss database failed." echo $result else echo "Init openGauss database success." - result=`su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"` + result=`su - opengauss -c "source /var/lib/opengauss/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"` if [ $? -ne 0 ]; then echo "Start openGauss database failed." echo $result @@ -264,7 +277,7 @@ remove_service(){ fi } clear_database(){ - pid=$(ps -ef | grep /var/lib/opengauss/data | grep -v grep | awk '{print $2}') + pid=$(ps -ef | grep /usr/local/opengauss/bin/gaussdb | grep -v grep | awk '{print $2}') if [ "$pid" != "" ]; then kill -9 $pid fi @@ -288,7 +301,10 @@ fi %changelog -* Thur Jan 27 2022 zhangxubo - 2.1.0-4 +* Sat Mar 12 2022 zhangxubo - 2.1.0-5 +- Fix bugs: #I4VDYQ #I4V624 #I4UOUU #I4TCDB #I4TCB8 + +* Thu Jan 27 2022 zhangxubo - 2.1.0-4 - Fix bugs: #I4SDWX * Sat Jan 22 2022 zhangxubo - 2.1.0-3 -- Gitee From 8ae792110e3bdc42c7e9b8c608272208155501f3 Mon Sep 17 00:00:00 2001 From: ouyanglearnning Date: Thu, 14 Apr 2022 14:57:03 +0800 Subject: [PATCH 3/3] add kylinsec platform --- 0002-add-kylinsec-platform.patch | 32 ++++++++++++++++++++++++++++++++ opengauss-server.spec | 7 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0002-add-kylinsec-platform.patch diff --git a/0002-add-kylinsec-platform.patch b/0002-add-kylinsec-platform.patch new file mode 100644 index 0000000..522dbff --- /dev/null +++ b/0002-add-kylinsec-platform.patch @@ -0,0 +1,32 @@ +From 02f0141586b12ca76582550a22894134e28c7962 Mon Sep 17 00:00:00 2001 +From: xiewenhao +Date: Wed, 30 Mar 2022 17:32:43 +0800 +Subject: [PATCH 2/2] add kylinsec platform + +--- + openGauss-server-2.1.0/src/get_PlatForm_str.sh | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/openGauss-server-2.1.0/src/get_PlatForm_str.sh b/openGauss-server-2.1.0/src/get_PlatForm_str.sh +index 9fff29a..3f222cd 100755 +--- a/openGauss-server-2.1.0/src/get_PlatForm_str.sh ++++ b/openGauss-server-2.1.0/src/get_PlatForm_str.sh +@@ -135,6 +135,15 @@ then + plat_form_str=kylin_"$cpu_bit" + fi + ++################################################################################## ++# kylinsec platform ++# the result form like this: kylinsec_aarch64 ++################################################################################## ++if [ "$kernel"x = "kylinsec"x ] ++then ++ plat_form_str=kylinsec_"$cpu_bit" ++fi ++ + ################################################################################## + # ubuntu platform + # the result form like this: ubuntu_x86_64 +-- +2.18.1 + diff --git a/opengauss-server.spec b/opengauss-server.spec index f414ffd..35c5696 100755 --- a/opengauss-server.spec +++ b/opengauss-server.spec @@ -12,7 +12,7 @@ Name: opengauss Version: 2.1.0 -Release: 5 +Release: 6 Summary: openGauss is an open source relational database management system License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0 URL: https://gitee.com/opengauss/openGauss-server @@ -32,6 +32,7 @@ Patch21: 0002-zlib.patch Patch22: 0003-zlib.patch Patch23: makefile-miniunz.patch Patch40: 0001-orc.patch +Patch41: 0002-add-kylinsec-platform.patch BuildRequires: cmake gcc gcc-c++ openssl-devel python BuildRequires: cjson lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel @@ -85,6 +86,7 @@ pushd %{orc_name}-%{orc_version} %patch40 -p1 popd +%patch41 -p1 %build ########### build cjson ########### build_target=$(pwd)/deps_binarylibs @@ -301,6 +303,9 @@ fi %changelog +* Wed Mar 30 2022 ouyangminxiang - 2.1.0-6 +- add kylinsec platform + * Sat Mar 12 2022 zhangxubo - 2.1.0-5 - Fix bugs: #I4VDYQ #I4V624 #I4UOUU #I4TCDB #I4TCB8 -- Gitee