blob: 34e09789803f75beb9ad3c6c0db860ff5b04292e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/bin/sh
# $FreeBSD$
# PROVIDE: logstash_forwarder
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable logstash-forwarder:
# logstash_forwarder_enable (bool): Set to YES to logstash-forwarder
# Default: NO
# logstash_forwarder_flags (str): Extra flags passed to logstash-forwarder
# logstash_forwarder_conf (str): logstash-forwarder configuration file
# Default: ${PREFIX}/etc/logstash-forwarder.conf
. /etc/rc.subr
name="logstash_forwarder"
rcvar=logstash_forwarder_enable
command="%%PREFIX%%/bin/logstash-forwarder"
command_args='> /dev/null 2>&1 &'
load_rc_config $name
[ -z "$logstash_forwarder_enable" ] && logstash_forwarder_enable="NO"
[ -z "$logstash_forwarder_conf" ] && logstash_forwarder_conf="%%PREFIX%%/etc/logstash-forwarder.conf"
[ -z "$logstash_forwarder_flags" ] && logstash_forwarder_flags=""
[ -n "$logstash_forwarder_conf" ] && logstash_forwarder_flags="$logstash_forwarder_flags -config=$logstash_forwarder_conf"
run_rc_command "$1"
|