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

Re: [Xen-users] gentoo startup scripts



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

 


Rackspace

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