mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-11-04 10:21:36 +01:00 
			
		
		
		
	* initd now uses supervise-daemon for service supervision * removes duplicate --with-http_realip_module * removes scgi_params & uwsgi_params as the servers are disabled
		
			
				
	
	
		
			49 lines
		
	
	
		
			823 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			823 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#!/sbin/openrc-run
 | 
						|
supervisor=supervise-daemon
 | 
						|
 | 
						|
description="Nginx http and reverse proxy server"
 | 
						|
extra_started_commands="reload reopen upgrade"
 | 
						|
 | 
						|
cfgfile=${cfgfile:-/etc/nginx/nginx.conf}
 | 
						|
pidfile=/run/nginx/$RC_SVCNAME.sd.pid
 | 
						|
command=/usr/sbin/nginx
 | 
						|
command_args="-c $cfgfile"
 | 
						|
command_args_foreground='-g "daemon off;"'
 | 
						|
required_files="$cfgfile"
 | 
						|
 | 
						|
depend() {
 | 
						|
	need net
 | 
						|
	use dns logger netmount
 | 
						|
}
 | 
						|
 | 
						|
start_pre() {
 | 
						|
	ebegin
 | 
						|
	checkpath --directory --owner nginx:nginx ${pidfile%/*}
 | 
						|
	$command $command_args -t -q
 | 
						|
	eend $?
 | 
						|
}
 | 
						|
 | 
						|
reload() {
 | 
						|
	ebegin "Reloading ${SVCNAME} configuration"
 | 
						|
	start_pre && $command -s reload
 | 
						|
	eend $?
 | 
						|
}
 | 
						|
 | 
						|
reopen() {
 | 
						|
	ebegin "Reopening ${SVCNAME} log files"
 | 
						|
	$command -s reopen
 | 
						|
	eend $?
 | 
						|
}
 | 
						|
 | 
						|
upgrade() {
 | 
						|
	restart
 | 
						|
}
 | 
						|
 | 
						|
restart() {
 | 
						|
	stop
 | 
						|
	# prevents bind() failed (98: Address in use) error msg
 | 
						|
	sleep 0.05
 | 
						|
	start
 | 
						|
}
 | 
						|
 |