diff options
author | Gennady Feldman <gena01@gmail.com> | 2017-01-02 21:45:06 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-02-07 10:31:47 +0200 |
commit | e67aea1521e6de3d9951f7428e67e074e03e66fc (patch) | |
tree | b9e18bdfc62dfe01a812201498a87eba611ff806 /testing/filebeat/filebeat.initd | |
parent | ef1fbe5fbeb1d0ef19091c4d2299a3123ab78765 (diff) | |
download | aports-e67aea1521e6de3d9951f7428e67e074e03e66fc.tar.bz2 aports-e67aea1521e6de3d9951f7428e67e074e03e66fc.tar.xz |
testing/filebeat: upgrade to 5.1.2 and add service script
* Upgrade to latest 5.1.2 release
* Added service script for filebeat
* Cleanup/update APKBUILD
Diffstat (limited to 'testing/filebeat/filebeat.initd')
-rw-r--r-- | testing/filebeat/filebeat.initd | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/filebeat/filebeat.initd b/testing/filebeat/filebeat.initd new file mode 100644 index 0000000000..d41f84d45e --- /dev/null +++ b/testing/filebeat/filebeat.initd @@ -0,0 +1,42 @@ +#!/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 -configtest -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 $? +} + |