41 lines
968 B
Bash
41 lines
968 B
Bash
#!/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 --daemonize=true --database_path /var/db/osquery/osqueryd --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"
|