refactor: print more logs in start-all.sh.
This commit is contained in:
parent
b41b054c49
commit
cbb5e69ead
@ -4,30 +4,34 @@ set -e
|
|||||||
|
|
||||||
if [ -f "/opt/maxkb/PG_VERSION" ]; then
|
if [ -f "/opt/maxkb/PG_VERSION" ]; then
|
||||||
# 如果是v1版本一键安装的的目录则退出
|
# 如果是v1版本一键安装的的目录则退出
|
||||||
echo "FATAL ERROR: Upgrade from v1 to v2 is not supported."
|
echo -e "\033[1;31mFATAL ERROR: Upgrade from v1 to v2 is not supported.\033[0m"
|
||||||
echo "The process will exit."
|
echo -e "\033[1;31mThe process will exit.\033[0m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MAXKB_DB_HOST" = "127.0.0.1" ]; then
|
if [ "$MAXKB_DB_HOST" = "127.0.0.1" ]; then
|
||||||
echo "PostgreSQL starting..."
|
echo -e "\033[1;32mPostgreSQL starting...\033[0m"
|
||||||
/usr/bin/start-postgres.sh &
|
/usr/bin/start-postgres.sh &
|
||||||
postgres_pid=$!
|
postgres_pid=$!
|
||||||
sleep 10
|
sleep 5
|
||||||
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 -e "\033[1;32mPostgreSQL started.\033[0m"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MAXKB_REDIS_HOST" = "127.0.0.1" ]; then
|
if [ "$MAXKB_REDIS_HOST" = "127.0.0.1" ]; then
|
||||||
echo "Redis starting..."
|
echo -e "\033[1;32mRedis starting...\033[0m"
|
||||||
/usr/bin/start-redis.sh &
|
/usr/bin/start-redis.sh &
|
||||||
redis_pid=$!
|
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 -e "\033[1;32mRedis started.\033[0m"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo -e "\033[1;32mMaxKB starting...\033[0m"
|
||||||
/usr/bin/start-maxkb.sh &
|
/usr/bin/start-maxkb.sh &
|
||||||
maxkb_pid=$!
|
maxkb_pid=$!
|
||||||
|
sleep 10
|
||||||
|
wait-for-it 127.0.0.1:8080 --timeout=60 --strict -- echo -e "\033[1;32mMaxKB started.\033[0m"
|
||||||
|
|
||||||
wait -n
|
wait -n
|
||||||
|
echo -e "\033[1;31mSystem is shutting down.\033[0m"
|
||||||
kill $postgres_pid $redis_pid $maxkb_pid 2>/dev/null
|
kill $postgres_pid $redis_pid $maxkb_pid 2>/dev/null
|
||||||
wait
|
wait
|
||||||
Loading…
Reference in New Issue
Block a user