22 lines
785 B
Plaintext
22 lines
785 B
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 1999-2019 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
VECTOR_USER="${VECTOR_USER:-vector}"
|
|
VECTOR_GROUP="${VECTOR_GROUP:-vector}"
|
|
VECTOR_CONFIG="${VECTOR_CONFIG:-/etc/vector/config.toml}"
|
|
VECTOR_DATA_DIR="${VECTOR_DATA_DIR:-/var/lib/vector}"
|
|
VECTOR_LOG_DIR="${VECTOR_LOG_DIR:-/var/log/vector}"
|
|
|
|
command="/usr/bin/vector"
|
|
command_args="--config ${VECTOR_CONFIG}"
|
|
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
command_background="true"
|
|
start_stop_daemon_args="--user=\"${VECTOR_USER}\" --group=\"${VECTOR_GROUP}\" --stdout ${VECTOR_LOG_DIR}/vector.log --stderr ${VECTOR_LOG_DIR}/vector.err"
|
|
|
|
start_pre() {
|
|
checkpath -d -o "${VECTOR_USER}" -m750 "${VECTOR_DATA_DIR}"
|
|
checkpath -d -o "${VECTOR_USER}" -m750 "${VECTOR_LOG_DIR}"
|
|
}
|