mirror of
https://git.freebsd.org/ports.git
synced 2025-05-01 19:16:39 -04:00
rc.d script doesn't use synapse_user variable in start_precmd PR: 262692 Reported by: Marcin Gryszkalis <mg at fork dot pl>
48 lines
1 KiB
Bash
48 lines
1 KiB
Bash
#!/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:=%%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 ${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"
|