mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-15 20:25:17 +03:00
42 lines
815 B
Bash
42 lines
815 B
Bash
#!/sbin/openrc-run
|
|
|
|
FILEBEAT_LOG_FILE="/var/log/${SVCNAME}.log"
|
|
|
|
name=filebeat
|
|
description="Beats - Lightweight shippers for Elasticsearch & Logstash"
|
|
description_checkconfig="Verify configuration file"
|
|
daemon=/usr/bin/$name
|
|
extra_commands="checkconfig"
|
|
|
|
start_pre() {
|
|
checkpath -f -m 0644 "$FILEBEAT_LOG_FILE"
|
|
}
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
checkconfig() {
|
|
filebeat test config -c /etc/filebeat/filebeat.yml
|
|
}
|
|
|
|
start() {
|
|
checkconfig || return 1
|
|
|
|
ebegin "Starting ${name}"
|
|
start-stop-daemon --start --quiet \
|
|
-m --pidfile /var/run/${name}.pid \
|
|
-b --stdout $FILEBEAT_LOG_FILE --stderr $FILEBEAT_LOG_FILE \
|
|
--exec ${daemon} -- ${filebeat_opts}
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping ${name}"
|
|
start-stop-daemon --stop --quiet \
|
|
--pidfile /var/run/${name}.pid \
|
|
--exec ${daemon}
|
|
eend $?
|
|
}
|
|
|