#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ opts="start stop status restart" # We expect config scripts for auto starting domains to be in # AUTODIR - they could just be symlinks to files elsewhere AUTODIR="/etc/xen/auto" depend() { need xend } get_domname() { sed -ne 's/^[ \t]*name[ \t]*=[ \t]*"\([^"]*\)"/\1/p' $1 } start() { einfo "Starting auto Xen domains" # Create all domains with config files in AUTODIR. for dom in $(ls $AUTODIR/* 2>/dev/null); do name=$(get_domname $dom) ebegin " Starting domain $name" xm create --quiet --defconfig $dom eend $? done } stop() { einfo "Shutting down auto Xen domains" # Stop all domains with config files in AUTODIR. for dom in $(ls $AUTODIR/* 2>/dev/null); do name=$(get_domname $dom) ebegin " Stopping domain $name" xm shutdown --halt --wait $name >/dev/null eend $? done } status() { xm list }