#!/bin/sh

# the following is the LSB init header see
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV
#
### BEGIN INIT INFO
# Provides: libvirtd
# Required-Start: $network messagebus
# Should-Start: $named
# Should-Start: xend
# Should-Start: avahi-daemon
# Required-Stop: $network messagebus
# Should-Stop: $named
# Default-Start: 3 4 5
# Short-Description: daemon for libvirt virtualization API
# Description: This is a daemon for managing guest instances
#              and libvirt virtual networks
#              See http://libvirt.org
### END INIT INFO

# the following is chkconfig init header
#
# libvirtd:   guest and virtual network management daemon
#
# chkconfig: 345 97 03
# description:  This is a daemon for managing guest instances \
#               and libvirt virtual networks \
#               See http://libvirt.org
#
# processname: libvirtd
# pidfile: /var/run/libvirtd.pid
#

BOOTSTRAP_FILE="/etc/init.d/calvados_bootstrap.cfg"
source $BOOTSTRAP_FILE

vmtype=`cat /proc/cmdline | sed 's/^.*vmtype=//' | cut -d" " -f1`
if [[ $VIRT_METHOD = "lxc" && "$vmtype" != "hostos" ]]; then
    echo "Libvirt not initialized for container instance"
    exit 0
fi

