annotate host/stop_nginx.sh @ 2142:506cc134c0fe nginx_decoupled

fix
author Violet7
date Mon, 19 Jan 2026 20:59:31 -0800
parents c62dfd37545f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1637
a65802b06b01 add nginx scripts
fffilimonov
parents:
diff changeset
1 #!/bin/bash
a65802b06b01 add nginx scripts
fffilimonov
parents:
diff changeset
2
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents: 2129
diff changeset
3 set -e
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents: 2129
diff changeset
4
2140
bc999d5036fb more robust stop_nginx.sh
Violet7
parents: 2136
diff changeset
5 PIDS=$(
2141
c62dfd37545f use regex trick to stop stop_nginx.sh from detecting itself
Violet7
parents: 2140
diff changeset
6 ps -eo pid,args |
c62dfd37545f use regex trick to stop stop_nginx.sh from detecting itself
Violet7
parents: 2140
diff changeset
7 awk '/[n]ginx: master process/ {print $1}'
2140
bc999d5036fb more robust stop_nginx.sh
Violet7
parents: 2136
diff changeset
8 )
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents: 2129
diff changeset
9
2140
bc999d5036fb more robust stop_nginx.sh
Violet7
parents: 2136
diff changeset
10 if [ -n "$PIDS" ]; then
2142
Violet7
parents: 2141
diff changeset
11 sudo kill -QUIT $PIDS
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents: 2129
diff changeset
12 else
2140
bc999d5036fb more robust stop_nginx.sh
Violet7
parents: 2136
diff changeset
13 echo "No nginx master process found, not attempting to stop."
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents: 2129
diff changeset
14 fi