build: update sh files.
This commit is contained in:
parent
cc06d07016
commit
295eb88947
@ -2,9 +2,17 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if [ -f "/var/lib/postgresql/data/PG_VERSION" ]; then
|
||||||
|
# 如果是v1版本一键安装的的目录则退出
|
||||||
|
echo "The existing data is from v1 and is not compatible with v2, installing v2 over v1 is not supported."
|
||||||
|
echo "The process will now exit."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$MAXKB_DB_HOST" = "127.0.0.1" ]; then
|
if [ "$MAXKB_DB_HOST" = "127.0.0.1" ]; then
|
||||||
echo "PostgreSQL starting..."
|
echo "PostgreSQL starting..."
|
||||||
/usr/bin/start-postgres.sh &
|
/usr/bin/start-postgres.sh &
|
||||||
|
postgres_pid=$!
|
||||||
sleep 10
|
sleep 10
|
||||||
wait-for-it 127.0.0.1:5432 --timeout=120 --strict -- echo "PostgreSQL started."
|
wait-for-it 127.0.0.1:5432 --timeout=120 --strict -- echo "PostgreSQL started."
|
||||||
fi
|
fi
|
||||||
@ -12,8 +20,14 @@ fi
|
|||||||
if [ "$MAXKB_REDIS_HOST" = "127.0.0.1" ]; then
|
if [ "$MAXKB_REDIS_HOST" = "127.0.0.1" ]; then
|
||||||
echo "Redis starting..."
|
echo "Redis starting..."
|
||||||
/usr/bin/start-redis.sh &
|
/usr/bin/start-redis.sh &
|
||||||
|
redis_pid=$!
|
||||||
sleep 5
|
sleep 5
|
||||||
wait-for-it 127.0.0.1:6379 --timeout=60 --strict -- echo "Redis started."
|
wait-for-it 127.0.0.1:6379 --timeout=60 --strict -- echo "Redis started."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/usr/bin/start-maxkb.sh
|
/usr/bin/start-maxkb.sh &
|
||||||
|
maxkb_pid=$!
|
||||||
|
|
||||||
|
wait -n
|
||||||
|
kill $postgres_pid $redis_pid $maxkb_pid 2>/dev/null
|
||||||
|
wait
|
||||||
@ -4,4 +4,5 @@ mkdir -p /opt/maxkb/logs
|
|||||||
mkdir -p /opt/maxkb/local
|
mkdir -p /opt/maxkb/local
|
||||||
mkdir -p /opt/maxkb/python-packages
|
mkdir -p /opt/maxkb/python-packages
|
||||||
|
|
||||||
|
rm -f /opt/maxkb-app/tmp/*.pid
|
||||||
python /opt/maxkb-app/main.py start
|
python /opt/maxkb-app/main.py start
|
||||||
Loading…
Reference in New Issue
Block a user