mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 05:17:07 +02:00
MetricBeat - Lightweight shipper for system and service https://www.elastic.co/products/beats
43 lines
842 B
Plaintext
43 lines
842 B
Plaintext
#!/sbin/openrc-run
|
|
|
|
METRICBEAT_LOG_FILE="/var/log/${SVCNAME}.log"
|
|
|
|
name=metricbeat
|
|
description="MetricBeat - Lightweight shipper for system and service statistics"
|
|
description_checkconfig="Verify configuration file"
|
|
daemon=/usr/bin/$name
|
|
extra_commands="checkconfig"
|
|
|
|
start_pre() {
|
|
checkpath -f -m 0644 "$METRICBEAT_LOG_FILE"
|
|
}
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
checkconfig() {
|
|
metricbeat -configtest -c /etc/metricbeat/metricbeat.yml
|
|
}
|
|
|
|
start() {
|
|
checkconfig || return 1
|
|
|
|
ebegin "Starting ${name}"
|
|
start-stop-daemon --start --quiet \
|
|
-m --pidfile /var/run/${name}.pid \
|
|
-b --stdout $METRICBEAT_LOG_FILE --stderr $METRICBEAT_LOG_FILE \
|
|
--exec ${daemon} -- ${metricbeat_opts}
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping ${name}"
|
|
start-stop-daemon --stop --quiet \
|
|
--pidfile /var/run/${name}.pid \
|
|
--exec ${daemon}
|
|
eend $?
|
|
}
|
|
|