1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00
freebsd-ports/sysutils/beats6/files/heartbeat.in
Greg Lewis 5d3e54d02e Move beats to beats6
This aligns it with the other ELK ports and makes room for beats7
2020-06-07 17:45:11 +00:00

38 lines
876 B
Bash

#!/bin/sh
# $FreeBSD$
# PROVIDE: heartbeat
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable heartbeat:
#
# heartbeat_enable (bool): Set to YES to enable heartbeat
# Default: NO
# heartbeat_flags (str): Extra flags passed to heartbeat
# heartbeat_conf (str): heartbeat configuration file
# Default: ${PREFIX}/etc/heartbeat.yml
. /etc/rc.subr
name="heartbeat"
rcvar=${name}_enable
load_rc_config $name
: ${heartbeat_enable:="NO"}
: ${heartbeat_config:="-path.home /var/db/beats/${name} -path.config %%PREFIX%%/etc"}
# daemon
start_precmd=heartbeat_prestart
command=/usr/sbin/daemon
pidfile="/var/run/${name}"
command_args="-rfP ${pidfile} %%PREFIX%%/sbin/${name} ${heartbeat_config}"
heartbeat_prestart() {
# Have to empty rc_flags so they don't get passed to daemon(8)
rc_flags=""
}
run_rc_command "$1"