freebsd-ports/sysutils/beats8/files/packetbeat.in
Juraj Lutter c7e874cca9 sysutils/beats8: New port
Add sysutils/beats8, beats component for ELK 8.x.

There are many breaking changes in 8.x versions, see
https://www.elastic.co/guide/en/beats/libbeat/8.5/breaking-changes-8.0.html
for details.

Release notes for ELK 8.x are located here:
https://www.elastic.co/guide/en/beats/libbeat/8.5/release-notes.html
2022-11-26 22:03:17 +01:00

43 lines
1.3 KiB
Bash

#!/bin/sh
# PROVIDE: packetbeat
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable packetbeat
#
# packetbeat_enable (bool): Set to YES to enable packetbeat
# Default: NO
# packetbeat_flags (str): Extra flags passed to packetbeat
# packetbeat_config (str): packetbeat configuration directory
# Default: ${PREFIX}/etc/beats
# packetbeat_conffile (str): packetbeat configuration file
# relative to ${packetbeat_conf}
# Default: packetbeat.yml
. /etc/rc.subr
name="packetbeat"
rcvar=${name}_enable
load_rc_config $name
: ${packetbeat_enable:="NO"}
: ${packetbeat_config:="%%ETCDIR%%"}
: ${packetbeat_conffile:="packetbeat.yml"}
: ${packetbeat_home:="%%DATADIR%%/packetbeat"}
: ${packetbeat_logs:="/var/log/beats"}
: ${packetbeat_data:="/var/db/beats/packetbeat"}
# daemon
start_precmd=packetbeat_prestart
command=/usr/sbin/daemon
pidfile="/var/run/${name}"
command_args="-frP ${pidfile} %%PREFIX%%/sbin/${name} ${packetbeat_flags} --path.config ${packetbeat_config} --path.home ${packetbeat_home} --path.data ${packetbeat_data} --path.logs ${packetbeat_logs} -c ${packetbeat_conffile}"
packetbeat_prestart() {
# Have to empty rc_flags so they don't get passed to daemon(8)
rc_flags=""
}
run_rc_command "$1"