#!/sbin/openrc-run # Copyright 1999-2018 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 GOGS_USER="${GOGS_USER:-gogs}" GOGS_HOME="${GOGS_HOME:-/var/lib/gogs}" GOGS_CONFIG="${GOGS_CONFIG:-${GOGS_HOME}/conf/app.ini}" GOGS_LOGDIR="${GOGS_LOGDIR:-/var/log/gogs}" output_log="${output_log:-/dev/null}" error_log="${error_log:-${GOGS_LOGDIR}/error.log}" name="${name:-Gogs}" command="/usr/bin/gogs" command_args="web --config ${GOGS_CONFIG} ${GOGS_OPTS}" command_user="${command_user:-${GOGS_USER}:gogs}" command_background=true directory="${GOGS_HOME}" pidfile="/run/${RC_SVCNAME}.pid" required_files="${GOGS_CONFIG}" retry="${retry:-TERM/30/KILL/5}" start_stop_daemon_args="${SSD_OPTS} -e \"GOGS_WORK_DIR=${GOGS_HOME}\" -e \"USER=${GOGS_USER}\"" depend() { need net } start_pre() { checkpath -d -m 0750 -o "${command_user}" "${GOGS_HOME}" "${GOGS_LOGDIR}" checkpath -f -m 0600 -o "${command_user}" "${GOGS_CONFIG}" }