December 22 update
This commit is contained in:
158
jails/config/matrix/nginx
Executable file
158
jails/config/matrix/nginx
Executable file
@ -0,0 +1,158 @@
|
||||
#!/bin/sh
|
||||
|
||||
# PROVIDE: nginx
|
||||
# REQUIRE: LOGIN cleanvar
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf to enable nginx:
|
||||
# nginx_enable (bool): Set to "NO" by default.
|
||||
# Set it to "YES" to enable nginx
|
||||
# nginx_profiles (str): Set to "" by default.
|
||||
# Define your profiles here.
|
||||
# nginx_pid_prefix (str): Set to "" by default.
|
||||
# When using profiles manually assign value to "nginx_"
|
||||
# for prevent collision with other PIDs names.
|
||||
# nginxlimits_enable (bool): Set to "NO" by default.
|
||||
# Set it to yes to run `limits $limits_args`
|
||||
# just before nginx starts.
|
||||
# nginx_reload_quiet (bool): Set to "NO" by default.
|
||||
# Set it to yes to suppress info output when testng config.
|
||||
# nginx_flags (str): Set to "" by default.
|
||||
# Extra flags passed to start command.
|
||||
# nginxlimits_args (str): Default to "-e -U www"
|
||||
# Arguments of pre-start limits run.
|
||||
# nginx_http_accept_enable (bool): Set to "NO" by default.
|
||||
# Set to yes to check for accf_http kernel module
|
||||
# on start-up and load if not loaded.
|
||||
# nginx_sig_stop (str): Default to "TERM"
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="nginx"
|
||||
rcvar=nginx_enable
|
||||
|
||||
start_precmd="nginx_prestart"
|
||||
stop_precmd="nginx_prestop"
|
||||
restart_precmd="nginx_checkconfig"
|
||||
reload_precmd="nginx_checkconfig"
|
||||
configtest_cmd="nginx_checkconfig"
|
||||
gracefulstop_cmd="nginx_gracefulstop"
|
||||
upgrade_precmd="nginx_checkconfig"
|
||||
upgrade_cmd="nginx_upgrade"
|
||||
command="/usr/local/sbin/nginx"
|
||||
_pidprefix="/var/run"
|
||||
pidfile="${_pidprefix}/${name}.pid"
|
||||
_tmpprefix="/var/tmp/nginx"
|
||||
required_files=/usr/local/etc/nginx/nginx.conf
|
||||
extra_commands="reload configtest upgrade gracefulstop"
|
||||
|
||||
[ -z "$nginx_enable" ] && nginx_enable="NO"
|
||||
[ -z "$nginxlimits_enable" ] && nginxlimits_enable="NO"
|
||||
[ -z "$nginxlimits_args" ] && nginxlimits_args="-e -U www"
|
||||
[ -z "$nginx_http_accept_enable" ] && nginx_http_accept_enable="NO"
|
||||
[ -z "$nginx_reload_quiet" ] && nginx_reload_quiet="NO"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
profile="$2"
|
||||
if [ "x${nginx_profiles}" != "x" ]; then
|
||||
pidfile="${_pidprefix}/${nginx_pid_prefix}${profile}.pid"
|
||||
eval nginx_configfile="\${nginx_${profile}_configfile:-}"
|
||||
if [ "x${nginx_configfile}" = "x" ]; then
|
||||
echo "You must define a configuration file (nginx_${profile}_configfile)"
|
||||
exit 1
|
||||
fi
|
||||
required_files="${nginx_configfile}"
|
||||
eval nginx_enable="\${nginx_${profile}_enable:-${nginx_enable}}"
|
||||
eval nginx_flags="\${nginx_${profile}_flags:-${nginx_flags}}"
|
||||
eval nginxlimits_enable="\${nginxlimits_${profile}_enable:-${nginxlimits_enable}}"
|
||||
eval nginxlimits_args="\${nginxlimits_${profile}_args:-${nginxlimits_args}}"
|
||||
nginx_flags="-c ${nginx_configfile} -g \"pid ${pidfile};\" ${nginx_flags}"
|
||||
else
|
||||
echo "$0: extra argument ignored"
|
||||
fi
|
||||
else
|
||||
if [ "x${nginx_profiles}" != "x" -a "x$1" != "x" ]; then
|
||||
for profile in ${nginx_profiles}; do
|
||||
echo "===> nginx profile: ${profile}"
|
||||
/usr/local/etc/rc.d/nginx $1 ${profile}
|
||||
retcode="$?"
|
||||
if [ "0${retcode}" -ne 0 ]; then
|
||||
failed="${profile} (${retcode}) ${failed:-}"
|
||||
else
|
||||
success="${profile} ${success:-}"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# tmpfs(5)
|
||||
nginx_checktmpdir()
|
||||
{
|
||||
if [ ! -d ${_tmpprefix} ] ; then
|
||||
install -d -o www -g www -m 755 ${_tmpprefix}
|
||||
fi
|
||||
}
|
||||
|
||||
nginx_checkconfig()
|
||||
{
|
||||
nginx_checktmpdir
|
||||
|
||||
if checkyesno nginx_reload_quiet; then
|
||||
eval ${command} ${nginx_flags} -t -q
|
||||
else
|
||||
echo "Performing sanity check on nginx configuration:"
|
||||
eval ${command} ${nginx_flags} -t
|
||||
fi
|
||||
}
|
||||
|
||||
nginx_gracefulstop()
|
||||
{
|
||||
echo "Performing a graceful stop:"
|
||||
sig_stop="QUIT"
|
||||
run_rc_command ${rc_prefix}stop $rc_extra_args || return 1
|
||||
}
|
||||
|
||||
nginx_upgrade()
|
||||
{
|
||||
echo "Upgrading nginx binary:"
|
||||
|
||||
reload_precmd=""
|
||||
sig_reload="USR2"
|
||||
run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
|
||||
|
||||
sleep 1
|
||||
|
||||
echo "Stopping old binary:"
|
||||
|
||||
sig_reload="QUIT"
|
||||
pidfile="$pidfile.oldbin"
|
||||
run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
|
||||
}
|
||||
|
||||
nginx_prestart()
|
||||
{
|
||||
if checkyesno nginx_http_accept_enable
|
||||
then
|
||||
required_modules="$required_modules accf_http accf_data"
|
||||
fi
|
||||
|
||||
nginx_checkconfig
|
||||
|
||||
if checkyesno nginxlimits_enable
|
||||
then
|
||||
eval `/usr/bin/limits ${nginxlimits_args}` 2>/dev/null
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
nginx_prestop()
|
||||
{
|
||||
sig_stop="${nginx_sig_stop:-TERM}"
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
9
jails/config/matrix/pkg-list-details-old.txt
Normal file
9
jails/config/matrix/pkg-list-details-old.txt
Normal file
@ -0,0 +1,9 @@
|
||||
pkgp-freebsd-pkg____bash-5.2.9
|
||||
pkgp-freebsd-pkg____bash-completion-2.11_1,2
|
||||
pkgp-freebsd-pkg____element-web-1.11.14
|
||||
pkgp-freebsd-pkg____nano-6.4
|
||||
pkgp-freebsd-pkg____nginx-1.22.1_2,3
|
||||
pkgp-freebsd-pkg____pkg-1.18.4
|
||||
pkgp-freebsd-pkg____py39-matrix-synapse-1.71.0
|
||||
pkgp-freebsd-pkg____py39-matrix-synapse-ldap3-0.2.2
|
||||
pkgp-freebsd-pkg____py39-psycopg2-2.9.4
|
@ -1,9 +1,9 @@
|
||||
pkgp-freebsd-pkg____bash-5.1.16
|
||||
pkgp-freebsd-pkg____bash-completion-2.11_1,2
|
||||
pkgp-freebsd-pkg____element-web-1.10.8
|
||||
pkgp-freebsd-pkg____nano-6.0
|
||||
pkgp-freebsd-pkg____nginx-1.20.2_9,2
|
||||
pkgp-freebsd-pkg____pkg-1.17.5_1
|
||||
pkgp-freebsd-pkg____py38-matrix-synapse-1.55.2
|
||||
pkgp-freebsd-pkg____py38-matrix-synapse-ldap3-0.2.0
|
||||
pkgp-freebsd-pkg____py38-psycopg2-2.9.3
|
||||
pkgp-freebsd-pkg____bash-5.2.12
|
||||
pkgp-freebsd-pkg____bash-completion-2.11_2,2
|
||||
pkgp-freebsd-pkg____element-web-1.11.15
|
||||
pkgp-freebsd-pkg____nano-7.0
|
||||
pkgp-freebsd-pkg____nginx-1.22.1_2,3
|
||||
pkgp-freebsd-pkg____pkg-1.18.4
|
||||
pkgp-freebsd-pkg____py39-matrix-synapse-1.71.0_1
|
||||
pkgp-freebsd-pkg____py39-matrix-synapse-ldap3-0.2.2
|
||||
pkgp-freebsd-pkg____py39-psycopg2-2.9.4
|
||||
|
1
jails/config/matrix/pkg-list-old.txt
Normal file
1
jails/config/matrix/pkg-list-old.txt
Normal file
@ -0,0 +1 @@
|
||||
bash bash-completion element-web nano nginx pkg py39-matrix-synapse py39-matrix-synapse-ldap3 py39-psycopg2
|
@ -1 +1 @@
|
||||
bash bash-completion element-web nano nginx pkg py38-matrix-synapse py38-matrix-synapse-ldap3 py38-psycopg2
|
||||
bash bash-completion element-web nano nginx pkg py39-matrix-synapse py39-matrix-synapse-ldap3 py39-psycopg2
|
||||
|
48
jails/config/matrix/synapse
Executable file
48
jails/config/matrix/synapse
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Created by: Mark Felder <feld@FreeBSD.org>
|
||||
|
||||
# PROVIDE: synapse
|
||||
# REQUIRE: LOGIN postgresql
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# Add the following line to /etc/rc.conf to enable `synapse':
|
||||
#
|
||||
# synapse_enable="YES"
|
||||
|
||||
. /etc/rc.subr
|
||||
name=synapse
|
||||
|
||||
rcvar=synapse_enable
|
||||
load_rc_config ${name}
|
||||
|
||||
: ${synapse_enable:=NO}
|
||||
: ${synapse_user:=synapse}
|
||||
: ${synapse_conf:=/usr/local/etc/matrix-synapse/homeserver.yaml}
|
||||
: ${synapse_dbdir:=/var/db/matrix-synapse}
|
||||
: ${synapse_logdir:=/var/log/matrix-synapse}
|
||||
: ${synapse_pidfile:=/var/run/matrix-synapse/homeserver.pid}
|
||||
|
||||
pidfile="${synapse_pidfile}"
|
||||
procname=/usr/local/bin/python3.9
|
||||
command=/usr/local/bin/python3.9
|
||||
command_args="-m synapse.app.homeserver --daemonize -c ${synapse_conf}"
|
||||
start_precmd=start_precmd
|
||||
|
||||
start_precmd()
|
||||
{
|
||||
if [ ! -d ${synapse_pidfile%/*} ] ; then
|
||||
install -d -o ${synapse_user} -g wheel ${synapse_pidfile%/*};
|
||||
fi
|
||||
|
||||
if [ ! -d ${synapse_dbdir} ] ; then
|
||||
install -d -o ${synapse_user} -g wheel ${synapse_dbdir};
|
||||
fi
|
||||
|
||||
if [ ! -d ${synapse_logdir} ] ; then
|
||||
install -d -o ${synapse_user} -g wheel ${synapse_logdir};
|
||||
fi
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
Reference in New Issue
Block a user