diff --git a/src/gunicorn.conf.py b/src/gunicorn.conf.py index 0692532..9a2a458 100644 --- a/src/gunicorn.conf.py +++ b/src/gunicorn.conf.py @@ -9,4 +9,4 @@ workers = 1 threads = 1 bind = f"{app_host}:{app_port}" daemon = True -pidfile = './gunicorn.pid' \ No newline at end of file +pidfile = './gunicorn.pid' diff --git a/src/wg-dashboard.service b/src/wg-dashboard.service index d6ca41f..1722b3a 100644 --- a/src/wg-dashboard.service +++ b/src/wg-dashboard.service @@ -11,4 +11,4 @@ Restart=always [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target \ No newline at end of file diff --git a/src/wgd.sh b/src/wgd.sh index c0b5344..e948cde 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -240,6 +240,16 @@ gunicorn_start () { sudo "$venv_gunicorn" --access-logfile log/access_"$d".log \ --log-level 'debug' --capture-output \ --error-logfile log/error_"$d".log 'dashboard:app' + + checkPIDExist=0 + while [ $checkPIDExist -eq 0 ] + do + if [ ! -f './gunicorn.pid' ]; then + checkPIDExist=1 + fi + sleep 2 + done + printf "[WGDashboard] Log files is under ./log\n" printf "%s\n" "$dashes" }