auto now hosts django apps
added devfs_rule configs for jails configure mail ipv6 settings windows2019 VM
This commit is contained in:
		
							
								
								
									
										52
									
								
								jails/config/auto/portfolio
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										52
									
								
								jails/config/auto/portfolio
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,52 @@
 | 
			
		||||
# Copyright (c) 2018-2020, diyIT.org
 | 
			
		||||
# All rights reserved.
 | 
			
		||||
#
 | 
			
		||||
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
 | 
			
		||||
# https://diyit.org/license/
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
# the two lines below are not just comments but required by rcorder; service -e
 | 
			
		||||
# PROVIDE: portfolio
 | 
			
		||||
# REQUIRE: NETWORKING DAEMON
 | 
			
		||||
 | 
			
		||||
. /etc/rc.subr
 | 
			
		||||
 | 
			
		||||
: ${portfolio_enable="NO"}
 | 
			
		||||
 
 | 
			
		||||
name=portfolio
 | 
			
		||||
port=8000
 | 
			
		||||
appdir="/data/${name}"
 | 
			
		||||
 | 
			
		||||
rcvar=${name}_enable
 | 
			
		||||
 | 
			
		||||
GUNICORN_CMD="/usr/local/bin/gunicorn -D -b unix:/var/run/${name}.sock --log-file /var/log/${name}.log \
 | 
			
		||||
    --chdir ${appdir} ${name}.wsgi"
 | 
			
		||||
# GUNICORN_CMD="/usr/local/bin/gunicorn -D -b 0.0.0.0:${port} -b [::]:${port} --log-file /var/log/${name}.log \
 | 
			
		||||
#     --chdir ${appdir} ${name}.wsgi"
 | 
			
		||||
 | 
			
		||||
start_cmd="server_start"
 | 
			
		||||
stop_cmd="server_stop"
 | 
			
		||||
restart_cmd="server_restart"
 | 
			
		||||
 | 
			
		||||
server_start()
 | 
			
		||||
{
 | 
			
		||||
    $GUNICORN_CMD
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
server_stop()
 | 
			
		||||
{
 | 
			
		||||
    ps ax | grep -ie "gunicorn: master \[${name}.wsgi\]" | grep -v grep | awk '{print $1}' | xargs kill -9
 | 
			
		||||
    ps ax | grep -ie "gunicorn: worker \[${name}.wsgi\]" | grep -v grep | awk '{print $1}' | xargs kill -9
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
server_restart()
 | 
			
		||||
{
 | 
			
		||||
    ps ax | grep -ie "gunicorn: master \[${name}.wsgi\]" | grep -v grep | awk '{print $1}' | xargs kill -9
 | 
			
		||||
	server_start
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
load_rc_config ${name}
 | 
			
		||||
run_rc_command "$1"
 | 
			
		||||
		Reference in New Issue
	
	Block a user