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] Run a script after creating a domain

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Run a script after creating a domain
From: Steve Kemp <steve@xxxxxxxxxxxx>
Date: Thu, 14 Sep 2006 12:13:30 +0100
Delivery-date: Thu, 14 Sep 2006 04:13:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200609141147.51791@powerdrag>
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: <450893C0.50505@xxxxxxxxxxxxxxx> <200609141147.51791@powerdrag>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Thu, Sep 14, 2006 at 11:47:51AM +0100, Tom Z. Napierala wrote:
> Dnia Thursday 14 September 2006 00:26, Roberto Gonzalez Azevedo napisa??:
> > Is it possible to run a script after creating a domain ?
> > e.g.
> > xm create -c /etc/xen/auto/domain
> > ...
> > after this, execute a script.
> > e.g.
> > /etc/xen/scripts/myscript.sh
> > ...
> >
> >
> > Any ideas ?
> 
> You can use xen-tools package (http://xen-tools.org/software/xen-tools/). 
> Excellent tool, you can run several hooks after creating domain, there are 
> also "roles" you can assign to the dom during creation.

  I think the OP was more interested in running a script after the
 new domain had started - rather than after it had been created for
 the first time.

  My solution would be to right a shell script:

  #!/bin/sh
  # /usr/local/bin/start-vm
  #
  if [ -z "${1}"  ]; then echo "Usage: $0 domain; fi

  xm create ${1}
  if [ -x /etc/xen/${1}.sh ]; then
    /etc/xen/${1}.sh
  fi

  That will run "domain.sh" after starting "domain".

Steve
-- 
Debian GNU/Linux System Administration
http://www.debian-administration.org/


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