Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2017 03:10:47 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 212433] security/bro: Add rc script to work with rc.conf
Message-ID:  <bug-212433-13-M9YI5H4ngR@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-212433-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-212433-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212433

--- Comment #3 from Shirkdog <mshirk@daemon-security.com> ---
Actually, this is a better starting point. I was having some issues with br=
octl
deploy on my slower systems, so this works correctly with broctl

This rc script implements cleanup, install and status that works with broct=
l.=20

#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: bro
# REQUIRE: NETWORKING
# REQUIRE: LOGIN FILESYSTEMS
# KEYWORD: shutdown

. /etc/rc.subr

name=3D"bro"
rcvar=3D`set_rcvar`

start_cmd=3D"bro_start"
stop_cmd=3D"bro_stop"
restart_cmd=3D"bro_restart"
deploy_cmd=3D"bro_deploy"
install_cmd=3D"bro_install"
cleanup_cmd=3D"bro_cleanup"
restart_cmd=3D"bro_restart"
status_cmd=3D"bro_status"

extra_commands=3D"deploy install cleanup status restart"

: ${broctl_program:=3D/usr/local/bin/broctl}

bro_enable=3D${bro_enable-"NO"}

bro_start() {
    $broctl_program start
}

bro_stop() {
    $broctl_program stop
}

bro_restart() {
    local node =3D $1
    if [ "$node" ];
    then
        $broctl_program restart ${node}
    else
        $broctl_program restart
    fi
}
bro_deploy() {
    $broctl_program deploy
}

bro_install() {
    $broctl_program install
}

bro_cleanup() {
    local node =3D $1
    if [ "$node" ];
    then
        $broctl_program cleanup ${node}
    else
        $broctl_program cleanup
    fi
}

bro_status() {
    $broctl_program status
}

load_rc_config $name
run_rc_command "$1"

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212433-13-M9YI5H4ngR>