# All arguments must be in double or single quotes.
#
# $FreeBSD: src/etc/defaults/rc.conf,v 1.180 2003/06/26 09:50:50 smkelly Exp $
-# $DragonFly: src/etc/defaults/rc.conf,v 1.52 2008/10/03 00:26:21 hasso Exp $
##############################################################
### Important initial Boot-time options ####################
#jail_example_flags="-l -U root" # flags for jail(8)
##############################################################
+### VKernel options #########################################
+##############################################################
+
+vkernel_enable="NO" # Set to YES to enable starting of vkernels
+vkernel_list="" # Space separated list of names of vkernels
+
+#
+# Create an entry for each vkernel specified in vkernel_list
+# replacing 'example' by the name of the vkernel.
+#
+#vkernel_example_bin="/boot/kernel.VKERNEL"
+ # Path to the vkernel binary
+#vkernel_example_memsize="64m"
+ # Amount of memory for the vkernel
+#vkernel_example_rootimg_list="/var/vkernel/rootimg.01"
+ # Space separated list of disk images
+#vkernel_example_iface_list="auto:bridge0"
+ # Optional: space separated list network interfaces for the vkernel
+#vkernel_example_logfile="/dev/null"
+ # Optional: path to the console log file
+#vkernel_example_flags="-U"
+ # Optional: aditional flags to start the vkernel with
+
+##############################################################
### Define source_rc_confs, the mechanism used by /etc/rc.* ##
### scripts to source rc_conf_files overrides safely. ##
##############################################################
# $NetBSD: Makefile,v 1.16 2001/01/14 15:37:22 minoura Exp $
# $FreeBSD: src/etc/rc.d/Makefile,v 1.20 2003/06/29 05:15:57 mtm Exp $
-# $DragonFly: src/etc/rc.d/Makefile,v 1.31 2008/10/03 10:27:42 swildner Exp $
.include <bsd.own.mk>
-# note: bgfsk, devfs, and lomac left out (from 5.0)
+# note: bgfsk and lomac left out (from 5.0)
#
FILES= DAEMON LOGIN NETWORKING SERVERS abi accounting addswap adjkerntz \
amd apm apmd atm1 atm2 atm3 \
quota random rarpd rcconf resident rndcontrol root route6d routed \
routing rpcbind rtadvd rtsold rwho sysdb savecore sdpd securelevel \
sendmail sensorsd serial sppp sshd statd swap1 syscons sysctl syslogd \
- timed ttys usbd varsym vinum virecover watchdogd wpa_supplicant \
+ timed ttys usbd varsym vinum vkernel virecover \
+ watchdogd wpa_supplicant \
ypbind yppasswdd ypserv ypset ypupdated ypxfrd
FILESDIR= /etc/rc.d
--- /dev/null
+#!/bin/sh
+#
+
+# PROVIDE: vkernel
+# REQUIRE: LOGIN NETWORKING
+
+. /etc/rc.subr
+
+name="vkernel"
+rcvar=`set_rcvar`
+start_cmd="vkernel_start"
+stop_cmd="vkernel_stop"
+
+vkernel_start()
+{
+ echo -n 'Starting virtual kernels:'
+ for _vkernel in ${vkernel_list}
+ do
+ # Check if already running
+ eval pidfile="/var/run/vkernel.${_vkernel}.pid"
+ if [ -f "${_pidfile}" ]; then
+ echo
+ warn "Vkernel ${_vkernel} already running? (check ${pidfile})"
+ continue
+ fi
+
+ # Configure vkernel binary
+ eval _bin=\"\${vkernel_${_vkernel}_bin}\"
+ if [ -z "${_bin}" -o ! -x "${_bin}" ]; then
+ echo
+ warn "Missing or undefined binary for vkernel '${_vkernel}'. Skipping."
+ continue
+ else
+ bin=${_bin}
+ fi
+
+ # Configure vkernel memory
+ eval _memsize=\"\$vkernel_${_vkernel}_memsize\"
+ if [ -z "${_memsize}" ]; then
+ echo
+ warn "No memsize has been defined for vkernel '${_vkernel}'. Skipping."
+ continue
+ else
+ memsize="-m ${_memsize}"
+ fi
+
+ # Configure vkernel root image(s)
+ eval _rootimgs=\"\${vkernel_${_vkernel}_rootimg_list}\"
+ if [ -z "${_rootimgs}" ]; then
+ echo
+ warn "No root image has been defined for vkernel '${_vkernel}'. Skipping."
+ continue
+ else
+ for _rootimg in ${_rootimgs}
+ do
+ eval rootimgs=\"${rootimgs} -r ${_rootimg}\"
+ done
+ fi
+
+ # Configure optional vkernel network interface(s)
+ eval _ifaces=\"\${vkernel_${_vkernel}_iface_list}\"
+ if [ -n "${_ifaces}" ]; then
+ for _iface in ${_ifaces}
+ do
+ eval ifaces=\"${ifaces} -I ${_iface}\"
+ done
+ fi
+
+ # Configure optional console logfile
+ eval logfile=\"\${vkernel_${_vkernel}_logfile}\"
+ [ -z "${logfile}" ] && logfile="/dev/null"
+
+ # Configure optional flags
+ eval flags=\"\${vkernel_${_vkernel}_flags}\"
+
+ eval "daemon ${bin} ${memsize} ${rootimgs} ${ifaces} ${flags} -p ${pidfile} >>${logfile} 2>&1"
+ echo -n " ${_vkernel}"
+ done
+ echo '.'
+}
+
+vkernel_stop()
+{
+ for _vkernel in ${vkernel_list}
+ do
+ eval pidfile="/var/run/vkernel.${_vkernel}.pid"
+ if [ -f "${pidfile}" ]; then
+ eval pid=`cat ${pidfile}`
+ else
+ eval _bin=\"\${vkernel_${_vkernel}_bin}\"
+ if [ -n "$_bin" ]; then
+ eval pid=`ps auxwww | grep ${_bin} | grep -v grep | awk '{print $2}'`
+ fi
+ fi
+ if [ -z "${pid}" ]; then
+ warn "vkernel '${_vkernel}' not running?"
+ else
+ eval kill -TERM ${pid}
+ fi
+ done
+}
+
+
+load_rc_config $name
+run_rc_command "$1"
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.197 2003/07/28 13:56:00 mbr Exp $
-.\" $DragonFly: src/share/man/man5/rc.conf.5,v 1.61 2008/10/20 07:35:08 swildner Exp $
-.Dd December 12, 2009
+.\"
+.Dd April 8, 2010
.Dt RC.CONF 5
.Os
.Sh NAME
if
.Xr shutdown 8
has not completed within the specified time (in seconds).
+.It Va vkernel_enable
+.Pq Vt bool
+If set to
+.Dq Li NO ,
+any configured vkernels will not be started.
+.It Va vkernel_list
+.Pq Vt str
+A space separated list of names for vkernels.
+This is purely a configuration aid to help identify and
+configure multiple vkernels.
+The names specified in this list will be used to
+identify settings common to a vkernel instance.
+Assuming that the vkernel in question was named
+.Li example ,
+you would have the following dependent variables
+(filled with reference values in this text):
+.Bd -literal
+vkernel_example_bin="/usr/obj/usr/src/sys/VKERNEL/kernel.debug"
+vkernel_example_memsize="64m"
+vkernel_example_rootimg_list="/var/vkernel/rootimg.01"
+vkernel_example_iface_list="auto:bridge0"
+vkernel_example_logfile="/dev/null"
+vkernel_example_flags="-U"
+.Ed
+.Pp
+The last three are optional.
+They default to an empty string if not set, except for logfile which defaults to
+.Pa /dev/null
+if it is not set.
.El
.Sh FILES
.Bl -tag -width ".Pa /etc/start_if. Ns Aq Ar interface" -compact