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-users

Re: [Xen-users] gentoo startup scripts

To: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Subject: Re: [Xen-users] gentoo startup scripts
From: "Eric S. Johansson" <esj@xxxxxxxxxx>
Date: Wed, 30 Mar 2005 19:49:32 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 31 Mar 2005 00:49:43 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200503310235.42529.mark.williamson@xxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <424B4430.1090001@xxxxxxxxxx> <200503310235.42529.mark.williamson@xxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Mark Williamson wrote:
Does Gentoo have a parallelising init?

I don't think it is. Although I would not be surprised if one could make it so far more easily than the standard sysV mechanisms

Sounds civilised anyhow.

it's more civilized than many parts of the world like here in the states...


Is there any significant commonality with the existing scripts?

there is some but it's going to be difficult without externalizing the core elements in another set of files.

Could you please post them to the list (probably cc xen-devel also) so that we can all have a look. There's a fair few people using Gentoo / Xen now, I think. It'd be nice if they could be available online somewhere, maybe checked into the BK repo.

someone will need to approve the message as I'm not subscribe to -devel since I wasn't planning on being a developer. ;-)

As I said to somebody else who has a copy, they are bloody raw hunks of code that still have a way to go before they can scab over and heal..

here is hoping attachments work over the mailing list

---eric
#!/sbin/runscript
#
# /etc/init.d/xendomains
# Start / stop domains automatically when domain 0 boots / shuts down.
#

# This script offers fairly basic functionality.  It works on gentoo.
# 

depend() {
        need  xend
}


start() {
    ebegin "Starting xendomains"

    # We expect config scripts for auto starting domains to be in
    # AUTODIR - they could just be symlinks to files elsewhere
    if [ -d $AUTODIR ] && [ $(ls $AUTODIR | wc -l) -gt 0 ]; then
        
       # Create all domains with config files in AUTODIR.
        for dom in  $AUTODIR/*; do
            xm create --quiet --defconfig $dom
            if [ $? -ne 0 ]; then
                RETVAL=$?
            fi
        done

    fi
    eend $?
}

stop()
{
    # NB. this shuts down ALL Xen domains (politely), not just the ones in
    # AUTODIR/*
    # This is because it's easier to do ;-) but arguably if this script is run
    # on system shutdown then it's also the right thing to do.
    
    ebegin "Shutting down xendomains"
    xm shutdown --all --wait --halt
    eend $?

}

#!/sbin/runscript
#
# xend          Script to start and stop the Xen control daemon.
#
# Author:       Keir Fraser <keir.fraser@xxxxxxxxxxxx>
#

# Wait for Xend / Xfrd to be up
depend() {
        need net
        # provide xend
        before xendomains
}

await_daemons_up()
{
        i=1
        rets=10
        xend status
        while [ $? -ne 0 -a $i -lt $rets ]; do
            sleep 1
            echo -n .
            i=$(($i + 1))
            xend status
        done
}

start() {
        ebegin "starting virtual machines"
        xend start
        await_daemons_up
        eend $?
}

stop() {
        ebegin "starting virtual machines"
        xend stop
        eend $?
}

restart() {
        xend restart
        await_daemons_up
}


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>