mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
linux - force kill nginx if graceful one doesn't work
This commit is contained in:
parent
6e6c08a716
commit
bb6fd30739
3 changed files with 7 additions and 4 deletions
|
|
@ -18,7 +18,7 @@ services:
|
|||
- USE_GZIP=yes
|
||||
- www.example.com_USE_UI=yes
|
||||
- www.example.com_USE_REVERSE_PROXY=yes
|
||||
- www.example.com_REVERSE_PROXY_URL=/admin
|
||||
- www.example.com_REVERSE_PROXY_URL=/changeme
|
||||
- www.example.com_REVERSE_PROXY_HOST=http://bw-ui:7000
|
||||
- www.example.com_INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504
|
||||
networks:
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ function stop_nginx() {
|
|||
nginx -s stop
|
||||
if [ $? -ne 0 ] ; then
|
||||
log "SYSTEMCTL" "❌" "Error while sending stop signal to nginx"
|
||||
log "SYSTEMCTL" "ℹ️ " "Stopping nginx (force)..."
|
||||
kill -TERM $(cat /var/run/bunkerweb/nginx.pid)
|
||||
if [ $? -ne 0 ] ; then
|
||||
log "SYSTEMCTL" "❌" "Error while sending term signal to nginx"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
count=0
|
||||
|
|
@ -113,7 +118,7 @@ function start() {
|
|||
|
||||
# Start nginx
|
||||
log "SYSTEMCTL" "ℹ️" "Starting temp nginx ..."
|
||||
nginx
|
||||
nginx -e /var/log/bunkerweb/error.log
|
||||
if [ $? -ne 0 ] ; then
|
||||
log "SYSTEMCTL" "❌" "Error while executing temp nginx"
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -85,8 +85,6 @@ from logger import setup_logger # type: ignore
|
|||
from Database import Database # type: ignore
|
||||
from logging import getLogger
|
||||
|
||||
# logger = setup_logger("UI", getenv("LOG_LEVEL", "INFO"))
|
||||
|
||||
def stop_gunicorn():
|
||||
p = Popen(["pgrep", "-f", "gunicorn"], stdout=PIPE)
|
||||
out, _ = p.communicate()
|
||||
|
|
|
|||
Loading…
Reference in a new issue