Skip to content

Commit

Permalink
Modifies the default signal sent to nginx when terminating the contai…
Browse files Browse the repository at this point in the history
…ner to allow graceful exit.

Solution provided by @groyoh in #149 (comment)

Closes #149
  • Loading branch information
ajhodgson committed Jan 15, 2024
1 parent 57da475 commit 0a8686b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions image/nginx-passenger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ run touch /etc/service/nginx/down
run mkdir /etc/service/nginx-log-forwarder
run cp /pd_build/runit/nginx-log-forwarder /etc/service/nginx-log-forwarder/run

## Use SIGQUIT instead of SIGTERM to shutdown nginx
run mkdir -p /etc/service/nginx/control/
run cp /pd_build/runit/nginx-term /etc/service/nginx/control/t

run mkdir /var/run/passenger-instreg

run sed -i 's|invoke-rc.d nginx rotate|sv 1 nginx|' /etc/logrotate.d/nginx
Expand Down
4 changes: 4 additions & 0 deletions image/runit/nginx-term
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

sv q nginx

0 comments on commit 0a8686b

Please sign in to comment.