vector-bin: Add reload command to init script
Signed-off-by: Stefan Knoblich <stkn@bitplumber.de>
This commit is contained in:
@@ -11,11 +11,28 @@ VECTOR_LOG_DIR="${VECTOR_LOG_DIR:-/var/log/vector}"
|
||||
command="/usr/bin/vector"
|
||||
command_args="--config ${VECTOR_CONFIG}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="Reload the vector configuration"
|
||||
|
||||
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"
|
||||
|
||||
configtest() {
|
||||
ebegin "Checking configuration file"
|
||||
${command} validate --no-environment ${VECTOR_CONFIG}
|
||||
eend $? "Please check configuration for errors"
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -o "${VECTOR_USER}" -m750 "${VECTOR_DATA_DIR}"
|
||||
checkpath -d -o "${VECTOR_USER}" -m750 "${VECTOR_LOG_DIR}"
|
||||
configtest || return 1
|
||||
}
|
||||
|
||||
reload() {
|
||||
configtest || return 1
|
||||
ebegin "Refreshing vector configuration"
|
||||
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
|
||||
eend $? "Failed to reload vector"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user