#!/bin/sh

# PROVIDE: libvirtd
# REQUIRE: LOGIN virtlogd
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable libvirtd.
#
# libvirtd_enable (bool):       Set to 'YES' to enable
#                               Default: NO
#
# libvirtd_flags (str):         Custom additional arguments to be passed to libvirtd.
#                               For example, to make it listen on TCP ports, set it
#                               to "--listen".
#                               Default: ""
#

. /etc/rc.subr

name=libvirtd
rcvar=libvirtd_enable

load_rc_config $name

: ${libvirtd_enable:="NO"}
: ${libvirtd_flags:=""}

command=%%PREFIX%%/sbin/libvirtd
pidfile=/var/run/${name}.pid

command_args="--daemon --pid-file=${pidfile}"

PATH="${PATH}:/usr/local/sbin:/usr/local/bin"

run_rc_command "$1"
