ports/devel/libvirt/files/libvirtd.in
Roman Bogorodskiy e3189e2bdd devel/libvirt: add GNUTLS option and custom flags support for rc script
- libvirt currently depends on gnutls, but does not really use it,
   so add GNUTLS option and pull gnutls only when it's turned on
 - add a "libvirtd_flags" variable to the rc script to allow users to
   specify e.g. "--listen" flag that's required to make libvirtd
   listen on TCP ports [1]
 - bump PORTREVISION

Differential Revision:	D5044
Reviewed by:		jgh, koobs
Tested by:		Nicolas Lienard [1]
2016-01-26 23:35:32 +00:00

37 lines
833 B
Bash

#!/bin/sh
# $FreeBSD$
#
# 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"