From 838144e66a4f9ce6f1ea7986c723ad6cbe6248f4 Mon Sep 17 00:00:00 2001 From: huangfeng Date: Thu, 3 Apr 2025 09:55:01 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=A2=9E=E5=8A=A0=E5=BC=80=E6=9C=BA?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E6=95=B0=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ncac/centos7/setup.sh | 7 +++++++ ncac/ubuntu22/setup.sh | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/ncac/centos7/setup.sh b/ncac/centos7/setup.sh index 0a7fe5c..2a30131 100644 --- a/ncac/centos7/setup.sh +++ b/ncac/centos7/setup.sh @@ -284,6 +284,12 @@ install61850(){ #################### 加入开机启动 ################################################ +setWaitDbStart(){ + echo 'while ! systemctl is-active --quiet mysqld; do' >> /etc/rc.d/rc.local + echo ' sleep 1' >> /etc/rc.d/rc.local + echo 'done' >> /etc/rc.d/rc.local + echo "" +} setAutoStartCac(){ if [ `grep -c ${BIN_DIR}/startCac.sh /etc/rc.d/rc.local` -eq '0' ]; then echo '#NewCAC' >> /etc/rc.d/rc.local @@ -368,6 +374,7 @@ fi if [ $MYSQL_INS == 1 ]; then installDatabase + setWaitDbStart fi if [ $DB_CREATE == 1 ]; then createDatabase diff --git a/ncac/ubuntu22/setup.sh b/ncac/ubuntu22/setup.sh index 4db5303..d515126 100644 --- a/ncac/ubuntu22/setup.sh +++ b/ncac/ubuntu22/setup.sh @@ -257,6 +257,12 @@ install61850(){ #################### 加入开机启动 ################################################ +setWaitDbStart(){ + echo 'while ! systemctl is-active --quiet mysqld; do' >> /etc/rc.local + echo ' sleep 1' >> /etc/rc.local + echo 'done' >> /etc/rc.local + echo "" +} setAutoStartCac(){ if [ `grep -c ${BIN_DIR}/startCac.sh /etc/rc.local` -eq '0' ]; then echo '#NewCAC' >> /etc/rc.local @@ -299,6 +305,7 @@ updateFirewall(){ ufw allow 443/tcp ufw allow 3306/tcp ufw allow 102/tcp + ufw allow 123/tcp } @@ -337,6 +344,7 @@ fi if [ $MYSQL_INS == 1 ]; then installDatabase + setWaitDbStart fi if [ $DB_CREATE == 1 ]; then createDatabase