aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/osquery/files/osqueryd.in
blob: 6145026efabcb98886dc14e943520b5f920ba3ae (plain) (blame)
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
37
38
39
40
41
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: osqueryd
# REQUIRE: %%REQUIRE%%
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable osqueryd:
#
# osqueryd_enable="YES"
#

. /etc/rc.subr

name=osqueryd
rcvar=osqueryd_enable
load_rc_config $name

command=%%PREFIX%%/sbin/osqueryd

osqueryd_enable=${osqueryd_enable-"NO"}
osqueryd_flags=${osqueryd_flags-""}
osqueryd_config=${osqueryd_config-"%%PREFIX%%/etc/osquery.conf"}
required_files=${osqueryd_config}
command_args="--pidfile /var/run/osqueryd.pid --disable_watchdog --daemonize=true --database_path /var/db/osquery/osqueryd --extensions_socket /var/run/osquery.em --extensions_autoload %%PREFIX%%/etc/osquery.extensions --modules_autoload %%PREFIX%%/etc/osquery.modules --tls_server_certs /etc/ssl/cert.pem --flagfile %%PREFIX%%/etc/osquery.flags --config_path=${osqueryd_config}"
extra_commands="configtest"
configtest_cmd="configtest"
pidfile="/var/run/osqueryd.pid"

start_precmd=prestart

configtest() {
    ${command} ${osqueryd_flags} --config_check --config_path=${osqueryd_config} --verbose
}

prestart() {
    install -d /var/db/osquery
}

run_rc_command "$1"