Files
gentoo-overlay/www-apps/gotosocial-bin/files/gotosocial.initd
2022-11-11 16:50:11 +01:00

22 lines
942 B
Plaintext

#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
GOTOSOCIAL_USER="${GOTOSOCIAL_USER:-gotosocial}"
GOTOSOCIAL_GROUP="${GOTOSOCIAL_GROUP:-gotosocial}"
GOTOSOCIAL_CONFIG="${GOTOSOCIAL_CONFIG:-/etc/gotosocial/config.yaml}"
GOTOSOCIAL_DATA_DIR="${GOTOSOCIAL_DATA_DIR:-/var/lib/gotosocial}"
GOTOSOCIAL_LOG_DIR="${GOTOSOCIAL_LOG_DIR:-/var/log/gotosocial}"
command="/usr/bin/gotosocial"
command_args="--config-path ${GOTOSOCIAL_CONFIG} server start"
pidfile="/run/${RC_SVCNAME}.pid"
command_background="true"
start_stop_daemon_args="--user=\"${GOTOSOCIAL_USER}\" --group=\"${GOTOSOCIAL_GROUP}\" --stdout ${GOTOSOCIAL_LOG_DIR}/gotosocial.log --stderr ${GOTOSOCIAL_LOG_DIR}/gotosocial.err --chdir ${GOTOSOCIAL_DATA_DIR}"
start_pre() {
checkpath -d -o "${GOTOSOCIAL_USER}" -m750 "${GOTOSOCIAL_DATA_DIR}"
checkpath -d -o "${GOTOSOCIAL_USER}" -m750 "${GOTOSOCIAL_LOG_DIR}"
}