Skip to content

Commit 295eb88

Browse files
build: update sh files.
1 parent cc06d07 commit 295eb88

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

installer/start-all.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,32 @@
22

33
set -e
44

5+
if [ -f "/var/lib/postgresql/data/PG_VERSION" ]; then
6+
# 如果是v1版本一键安装的的目录则退出
7+
echo "The existing data is from v1 and is not compatible with v2, installing v2 over v1 is not supported."
8+
echo "The process will now exit."
9+
exit 1
10+
fi
11+
512
if [ "$MAXKB_DB_HOST" = "127.0.0.1" ]; then
613
echo "PostgreSQL starting..."
714
/usr/bin/start-postgres.sh &
15+
postgres_pid=$!
816
sleep 10
917
wait-for-it 127.0.0.1:5432 --timeout=120 --strict -- echo "PostgreSQL started."
1018
fi
1119

1220
if [ "$MAXKB_REDIS_HOST" = "127.0.0.1" ]; then
1321
echo "Redis starting..."
1422
/usr/bin/start-redis.sh &
23+
redis_pid=$!
1524
sleep 5
1625
wait-for-it 127.0.0.1:6379 --timeout=60 --strict -- echo "Redis started."
1726
fi
1827

19-
/usr/bin/start-maxkb.sh
28+
/usr/bin/start-maxkb.sh &
29+
maxkb_pid=$!
30+
31+
wait -n
32+
kill $postgres_pid $redis_pid $maxkb_pid 2>/dev/null
33+
wait

installer/start-maxkb.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ mkdir -p /opt/maxkb/logs
44
mkdir -p /opt/maxkb/local
55
mkdir -p /opt/maxkb/python-packages
66

7+
rm -f /opt/maxkb-app/tmp/*.pid
78
python /opt/maxkb-app/main.py start

0 commit comments

Comments
 (0)