description "libvirt daemon"
author "Dustin Kirkland <kirkland@canonical.com>"

#start on (runlevel [2345] and net-device-up IFACE=br0)
start on (runlevel [2345] and started network-services)
#start on started networking
#start on (runlevel [2345] and net-device-up IFACE=br0 and net-device-added IFACE=br0)
#start on runlevel [2345]
stop on runlevel [!2345]

expect daemon
respawn

pre-start script
	mkdir -p /var/run/libvirt
	# Clean up a pidfile that might be left around
	rm -f /var/run/libvirtd.pid
	ifconfig > /home/wsadmin2/ifconfig1
	netstat -a >> /home/wsadmin2/netstat1
	cp /proc/modules /home/wsadmin2/modules1
	#sleep 6 
end script

# If you used to set $libvirtd_opts in /etc/default/libvirt-bin,
# change the 'exec' line here instead.
exec /usr/sbin/libvirtd -d

post-start script
	ifconfig > /home/wsadmin2/ifconfig2
	cp /proc/modules /home/wsadmin2/modules2
	netstat -a >> /home/wsadmin2/netstat2
end script

