Changeset View
Changeset View
Standalone View
Standalone View
head/net/py-matrix-synapse/files/synapse.in
Property | Old Value | New Value |
---|---|---|
fbsd:nokeywords | null | yes \ No newline at end of property |
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
#!/bin/sh | |||||
# | |||||
# Created by: Mark Felder <feld@FreeBSD.org> | |||||
# $FreeBSD$ | |||||
# | |||||
# 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:=%%USERS%%} | |||||
: ${synapse_conf:=%%ETCDIR%%/homeserver.yaml} | |||||
: ${synapse_dbdir:=%%DBDIR%%} | |||||
: ${synapse_logdir:=%%LOGDIR%%} | |||||
: ${synapse_pidfile:=%%PIDDIR%%/homeserver.pid} | |||||
pidfile="${synapse_pidfile}" | |||||
procname=%%PYTHON_CMD%% | |||||
command=%%PYTHON_CMD%% | |||||
command_args="-m synapse.app.homeserver --daemonize -c ${synapse_conf}" | |||||
start_precmd=start_precmd | |||||
start_precmd() | |||||
{ | |||||
if [ ! -d ${synapse_pidfile%/*} ] ; then | |||||
install -d -o %%USERS%% -g wheel ${synapse_pidfile%/*}; | |||||
fi | |||||
if [ ! -d ${synapse_dbdir} ] ; then | |||||
install -d -o %%USERS%% -g wheel ${synapse_dbdir}; | |||||
fi | |||||
if [ ! -d ${synapse_logdir} ] ; then | |||||
install -d -o %%USERS%% -g wheel ${synapse_logdir}; | |||||
fi | |||||
if $(grep -q CHANGEME ${synapse_conf}) ; then | |||||
echo "Error: Default secret values in config." | |||||
echo "Please replace the CHANGEME values in ${synapse_conf}" | |||||
exit 1 | |||||
fi | |||||
} | |||||
run_rc_command "$1" |