Skip to content

Commit e7f7f10

Browse files
committed
Merge pull request alphagov#52 from alphagov/nginx_gracefulrestart
Add nginx.gracefulrestart
2 parents 32f06f6 + c8070e8 commit e7f7f10

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nginx.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ def gracefulstop(wait=True):
99
# Poll for Nginx, until it's no longer running.
1010
run('while pgrep nginx >/dev/null; do echo "Waiting for Nginx to exit.."; sleep 1; done')
1111

12+
@task
13+
def gracefulrestart():
14+
"""Gracefully shutdown and start Nginx (not reload)"""
15+
gracefulstop()
16+
start()
17+
1218
@task
1319
def disable_vhost(vhost_filename):
1420
"""Disable a vhost by removing its symlink from /etc/nginx/sites-enabled"""

0 commit comments

Comments
 (0)