ssm-services/init.d/nginx

33 lines
572 B
Plaintext
Raw Normal View History

2014-07-26 09:33:26 +00:00
#!/usr/bin/env watchman
service_command='/usr/bin/nginx'
service_pidfile='/run/nginx.pid'
2015-09-15 09:22:37 +00:00
nginx.test_config() { "$service_command" -t "$@"; }
conftest() {
nginx.test_config
}
2014-07-26 09:33:26 +00:00
reload() {
2015-09-15 09:22:37 +00:00
nginx.test_config -q || {
2014-07-26 09:33:26 +00:00
watchman.err "Nginx config test failed, not reloading."
return 1
}
watchman.reload
}
restart() {
2015-09-15 09:22:37 +00:00
nginx.test_config -q || {
2014-07-26 09:33:26 +00:00
watchman.err "Nginx config test failed, not restarting."
return 1
}
stop; start
}
2014-09-23 22:47:40 +00:00
upgrade() {
2014-09-30 02:00:16 +00:00
watchman.msg "This script has no zero-downtime upgrade support for nginx."
2014-09-23 22:47:40 +00:00
}