2014-07-26 09:33:26 +00:00
|
|
|
#!/usr/bin/env watchman
|
|
|
|
|
2014-07-28 01:00:57 +00:00
|
|
|
service_respawn='true'
|
2014-07-26 09:33:26 +00:00
|
|
|
service_command='/usr/bin/nginx'
|
|
|
|
service_pidfile='/run/nginx.pid'
|
|
|
|
|
|
|
|
nginx.test_config() { "$service_command" -tq; }
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
nginx.test_config || {
|
|
|
|
watchman.err "Nginx config test failed, not reloading."
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
watchman.reload
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
nginx.test_config || {
|
|
|
|
watchman.err "Nginx config test failed, not restarting."
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
stop; start
|
|
|
|
}
|