blob: 3393ff197de676fd169a54954daed42e925c12a4 (
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
33
34
35
36
|
#!/bin/sh
# 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"
|