wait until seafile-server is connectable before starting socat

This commit is contained in:
Gerrit Gogel 2021-02-01 18:16:11 +01:00
parent f9eca5c59a
commit 774ba43d4b

View file

@ -13,10 +13,11 @@ function start_seahub {
function start_socat {
mkdir -p /opt/seafile/seafile-server-latest/runtime
while true; do
echo "Starting socat..."
socat -d -d UNIX-LISTEN:/opt/seafile/seafile-server-latest/runtime/seafile.sock,fork TCP:seafile-server:8001,forever,keepalive,keepidle=10,keepintvl=10,keepcnt=2
while ! nc -z seafile-server 8001 2>/dev/null; do
sleep 1
done
echo "Starting socat..."
socat -d -d UNIX-LISTEN:/opt/seafile/seafile-server-latest/runtime/seafile.sock,fork TCP:seafile-server:8001,forever,keepalive,keepidle=10,keepintvl=10,keepcnt=2
}
function watch_server {