| 
									
										
										
										
											2014-07-26 13:33:26 +04:00
										 |  |  | #!/usr/bin/env watchman | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-09-24 02:47:40 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | upgrade() { | 
					
						
							| 
									
										
										
										
											2014-09-30 06:00:16 +04:00
										 |  |  | 	watchman.msg "This script has no zero-downtime upgrade support for nginx." | 
					
						
							| 
									
										
										
										
											2014-09-24 02:47:40 +04:00
										 |  |  | } |