[Bug 212433] security/bro: Add rc script to work with rc.conf

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jan 31 00:40:17 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212433

--- Comment #2 from Shirkdog <mshirk at daemon-security.com> ---
I added the "bro_program" variable for "service bro status" which seems to work
with 2.5 on FreeBSD 11/12

So as a starting point, this gives a start, stop and status command via the new
features in Bro. 


#!/bin/sh
#
# PROVIDE: bro
# REQUIRE: NETWORKING
# REQUIRE: LOGIN
# KEYWORD: shutdown
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:

. /etc/rc.subr

name="bro"
rcvar=`set_rcvar`

load_rc_config $name

start_cmd="bro_start"
stop_cmd="bro_stop"
restart_cmd="bro_restart"

: ${broctl_program:=/usr/local/bin/broctl}
: ${bro_program:=/usr/local/bin/bro}

bro_enable=${bro_enable-"NO"}

bro_start() {
    $broctl_program deploy
}

bro_stop() {
    $broctl_program stop
}

bro_restart() {
    bro_stop
    bro_start
}

run_rc_command "$1"

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list