Mercurial Hosting > luan
comparison host/stop_nginx.sh @ 2140:bc999d5036fb nginx_decoupled
more robust stop_nginx.sh
| author | Violet7 |
|---|---|
| date | Mon, 19 Jan 2026 20:37:47 -0800 |
| parents | 3ca8f933209d |
| children | c62dfd37545f |
comparison
equal
deleted
inserted
replaced
| 2139:68b055359b2b | 2140:bc999d5036fb |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 set -e | 3 set -e |
| 4 # currently unused | |
| 4 . nginx_common.sh | 5 . nginx_common.sh |
| 5 | 6 |
| 6 NGINX_PID_FILE="$NGINX_PID_DIR/nginx.pid" | 7 PIDS=$( |
| 8 ps -eo pid,comm,args | | |
| 9 awk '/nginx: master process/ {print $1}' | |
| 10 ) | |
| 7 | 11 |
| 8 # if file exists and is non empty | 12 if [ -n "$PIDS" ]; then |
| 9 if [ -s "$NGINX_PID_FILE" ]; then | 13 kill -QUIT $PIDS |
| 10 sudo nginx -c $NGINX_ROOT_CONFIG_FILE -s stop | |
| 11 else | 14 else |
| 12 echo "PID file empty or non existent, doing nothing." | 15 echo "No nginx master process found, not attempting to stop." |
| 13 fi | 16 fi |
