ssm-services/init.d/nginx

33 lines
572 B
Plaintext
Executable File

#!/usr/bin/env watchman
service_command='/usr/bin/nginx'
service_pidfile='/run/nginx.pid'
nginx.test_config() { "$service_command" -t "$@"; }
conftest() {
nginx.test_config
}
reload() {
nginx.test_config -q || {
watchman.err "Nginx config test failed, not reloading."
return 1
}
watchman.reload
}
restart() {
nginx.test_config -q || {
watchman.err "Nginx config test failed, not restarting."
return 1
}
stop; start
}
upgrade() {
watchman.msg "This script has no zero-downtime upgrade support for nginx."
}