WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] xendomains init script

To: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] xendomains init script
From: Chris Bainbridge <chris.bainbridge@xxxxxxxxx>
Date: Wed, 26 Oct 2005 23:35:42 +0000
Delivery-date: Wed, 26 Oct 2005 23:32:54 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tb9LwM6MDctdJj7WhID2O7dlEvBCoDnlMClKqmJYueIFz2ZdppcA/2HPt9naDzMUO1UYRcTNknclxAk5xug1qh63379lbUvWfmP/fPEXfdAeHKgP0teV2IxMozOoMf8/2CxWgKVYXFqOAEq8BpEhZJojAYlBj9lpLlAzcZ+V0Wo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <A95E2296287EAD4EB592B5DEEFCE0E9D32E5D0@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <A95E2296287EAD4EB592B5DEEFCE0E9D32E5D0@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 26/10/05, Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx> wrote:
> > I think about adding one more feature to the script:

Here's another feature... I'm not sure if anyone else will need this,
but we had a requirement to log all console output, and to have
console windows available at all time and potentially multiplexed
between users. I solved it by having each xen domain start up in a
persistent window inside a screen session.

My (gentoo) xendomains start() and stop() currently look like:

start() {
        einfo "Starting ${AUTODIR} Xen domains"
        if [[ ${SCREEN} == "yes" ]]; then
                screen -d -m -S xen -t xen-cbc0
                screen -r xen -X zombie dr
                logrotate -f /usr/share/xen/xen-consoles-logrotate
                screen -r xen -X logfile /var/log/xen-consoles/%t
                screen -r xen -X logfile flush 1
                screen -r xen -X deflog on
        fi
        # Create all domains with config files in AUTODIR.
        for dom in $(ls ${AUTODIR}/* 2>/dev/null); do
                name=$(get_domname ${dom})
                if ! is_running ${name} ; then
                        ebegin "  Starting domain ${name}"
                        if [[ ${SCREEN} == "yes" ]]; then
                                screen -r xen -X screen -t ${name} xm
create ${dom} -c
                        else
                                xm create --quiet ${dom}
                        fi
                        eend $?
                else
                        einfo "  Not Starting domain ${name} - allready running"
                fi
        done
}

stop() {
        einfo "Shutting down ${AUTODIR} Xen domains"
        # Stop all domains with config files in AUTODIR.
        for dom in $(ls ${AUTODIR}/* 2>/dev/null); do
                name=$(get_domname ${dom})
                if is_running ${name} ; then
                        ebegin "  Stopping domain ${name}"
                                xm shutdown --wait ${name} >/dev/null
                        eend $?
                else
                        einfo "  Not Stopping domain ${name} - not running"
                fi
        done
        if [[ ${SCREEN} == "yes" ]]; then
                screen -r xen -X quit
        fi
}

It should be easy to adapt this to the generic script if others find it useful.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel