[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] xendomains init script


  • To: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.