start and stop seahub through seahub.sh and gunicorn

This commit is contained in:
Gerrit Gogel 2021-02-04 00:12:52 +01:00
parent b7ef93b362
commit cd4a8cc9db

View file

@ -7,8 +7,7 @@ function init_seahub {
} }
function start_seahub { function start_seahub {
echo "Starting seahub..." /opt/seafile/seafile-server-latest/seahub.sh start
python3 /opt/seafile/seafile-server-latest/seahub/manage.py runserver 0.0.0.0:8000
} }
function start_socat { function start_socat {
@ -26,8 +25,7 @@ function watch_server {
while true; do while true; do
sleep 2 sleep 2
if ! nc -z seafile-server 8082 2>/dev/null; then if ! nc -z seafile-server 8082 2>/dev/null; then
echo "Seafile server is unreachable. Stopping seahub..." /opt/seafile/seafile-server-latest/seahub.sh stop
pkill -f manage.py
while ! nc -z seafile-server 8082 2>/dev/null; do while ! nc -z seafile-server 8082 2>/dev/null; do
sleep 1 sleep 1
done done