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

Re: [Xen-users] execute command


  • To: Steve Brueckner <steve@xxxxxxxxxxxxxx>
  • From: Anand <xen.mails@xxxxxxxxx>
  • Date: Fri, 6 Jan 2006 03:08:29 +0530
  • Cc: Xen Users <Xen-users@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 05 Jan 2006 21:44:13 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=DQ3ZKqFUWe8+VaBHpJiKNimtSOH3IIdFBkiesALPhoJ5qP+c1DjC6+864+3CVYrzk/pSRa2cpDcGd64uyNiTF/2KX/mJh66nqST3kmI1vMHxUGKyHWDAqHrNug1kUMP02SRYxgPQoEHDWH+IeYSd+vQz3mSj5Njme+jUb6sTorE=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Thanks a lot for the script. I am still fighting with expect to get it installed.

It gives me the below error everytime i try to do a ./configure

checking for Tcl configuration... configure: warning: Can't find Tcl configuration definitions

I have tcl already installed and the tcl source is located in the same directory inside a sub directory tcl. Any ideas ?

On 1/6/06, Steve Brueckner <steve@xxxxxxxxxxxxxx> wrote:
Anand wrote:
> Would you mind sharing the script ?
>
>
> On 1/6/06, Steve Brueckner <steve@xxxxxxxxxxxxxx> wrote:
> Gémes Géza wrote:
>> Anand írta:
>>
>>> Is there a way to run a command inside a domX from dom0 and get its
>>> output in dom0 ?
>>>
>> ssh (rsh) ?
>
> I had a similar problem but could not use networking, so I wrote an
> Expect script that opened a console into the domU and executed the
> command.



Okay, here's a freebie.  This script gets the domU IP.  It requires the xenU
domain ID as an argument.  It is very rough and ugly and tweaked for my
machine (FC4), but maybe it will get you started.  Oh, and it anticipates
that a console might already be open into domU by username "developer".

#!/usr/bin/expect -f
set ID $argv
set timeout -1
spawn xm console $ID
match_max 100000
#wake up the console
sleep .4
send -- "\r"
#there are two cases:
expect {
        #if no console open
        "login:" {
                sleep .1
                send -- "developer\r"
                expect "Password:"
                sleep .1
                send -- "developer\r"
                expect "developer"
        #if console fully open
        } "developer" { }
}
#get ip address
sleep .1
send -- "/sbin/ifconfig eth0 | grep 'inet addr:'\r"
expect "/sbin/ifconfig"
#logout from console
send -- "logout\r"
expect "logout"
sleep .1
send -- ^C"
#expect eof

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



--

regards,

Anand
_______________________________________________
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®.