OpenVZ Forum


Home » Mailing lists » Users » Scripting ve creation
Scripting ve creation [message #15349] Fri, 27 July 2007 12:03 Go to next message
Steve Hodges is currently offline  Steve Hodges
Messages: 17
Registered: July 2007
Junior Member
From: openvz.org
I'm trying to script the creation of a number of VEs. The template is a
minimal Debian Etch.

part of what I'm trying to do is thinks like:

vzctl exec 110 apt-get install exim4

exim is one of those packages that wants to run dpkg-configure as part
of the install (actually I think it's dpkg-preconfigure, but it's the
same sort of thing)

When it gets to that stage it complains that it "can't re-open stdin"
and generally fails to complete the install.

Is there any way of executing a whole series of commands like this
without having to run them all manually. Some things have to be done
from outside the VE too, so just running a script in the VE is
problematic :-(

Steve
Re: Scripting ve creation [message #15353 is a reply to message #15349] Fri, 27 July 2007 13:56 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

From: openvz.org
Can you please run the following command:
# vzclt exec 110 strace -f -o /tmp/out apt-get install exim4
and send me /tmp/out file (it will be created inside VE)?

Thanks,
Kirill
P.S. it may require installing strace package first.

Steve Hodges wrote:
> I'm trying to script the creation of a number of VEs. The template is a
> minimal Debian Etch.
>
> part of what I'm trying to do is thinks like:
>
> vzctl exec 110 apt-get install exim4
>
> exim is one of those packages that wants to run dpkg-configure as part
> of the install (actually I think it's dpkg-preconfigure, but it's the
> same sort of thing)
>
> When it gets to that stage it complains that it "can't re-open stdin"
> and generally fails to complete the install.
>
> Is there any way of executing a whole series of commands like this
> without having to run them all manually. Some things have to be done
> from outside the VE too, so just running a script in the VE is
> problematic :-(
>
> Steve
Re: Scripting ve creation [message #15361 is a reply to message #15353] Sat, 28 July 2007 01:59 Go to previous messageGo to next message
Steve Hodges is currently offline  Steve Hodges
Messages: 17
Registered: July 2007
Junior Member
From: openvz.org
The file is on my web server

http://steve-is-mucking-about.sexypenguins.com/out.gz

I noticed that the command did not terminate and had to be killed (I
tried it a number of times with the same result)

the command I used was

vzctl exec 101 strace -f -o /tmp/out apt-get install exim4 -y

thanks

Steve

On 27/07/2007 9:56 PM, Kirill Korotaev wrote:
> Can you please run the following command:
> # vzclt exec 110 strace -f -o /tmp/out apt-get install exim4
> and send me /tmp/out file (it will be created inside VE)?
>
> Thanks,
> Kirill
> P.S. it may require installing strace package first.
>
> Steve Hodges wrote:
>
>> I'm trying to script the creation of a number of VEs. The template is a
>> minimal Debian Etch.
>>
>> part of what I'm trying to do is thinks like:
>>
>> vzctl exec 110 apt-get install exim4
>>
>> exim is one of those packages that wants to run dpkg-configure as part
>> of the install (actually I think it's dpkg-preconfigure, but it's the
>> same sort of thing)
>>
>> When it gets to that stage it complains that it "can't re-open stdin"
>> and generally fails to complete the install.
>>
>> Is there any way of executing a whole series of commands like this
>> without having to run them all manually. Some things have to be done
>> from outside the VE too, so just running a script in the VE is
>> problematic :-(
>>
>> Steve
Re: Scripting ve creation [message #15440 is a reply to message #15349] Tue, 31 July 2007 08:51 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

From: openvz.org
Steve,

Good to know. Anyway I've created a bug
http://bugzilla.openvz.org/show_bug.cgi?id=658
so we'll try to reproduce and resolve your issue.

Thanks,
Kirill

Steve Hodges wrote:
> We have a suitable workaround now. Instead of the creation script
> running all the installs etc, it writes to an install script in the VE.
> We then log in to the skeleton VE and run the script.
>
> Steve
>
>>>>hm... something went differently and there is no such a message
>>>>in strace :/
>>>>
>>>>can you give me an access to the node to check it?
>>>>
>>>>Thanks,
>>>>Kirill
>>>>
>>>>
>>>>Steve Hodges wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>The file is on my web server
>>>>>
>>>>>http://steve-is-mucking-about.sexypenguins.com/out.gz
>>>>>
>>>>>I noticed that the command did not terminate and had to be killed (I
>>>>>tried it a number of times with the same result)
>>>>>
>>>>>the command I used was
>>>>>
>>>>>vzctl exec 101 strace -f -o /tmp/out apt-get install exim4 -y
>>>>>
>>>>>thanks
>>>>>
>>>>>Steve
>>>>>
>>>>>On 27/07/2007 9:56 PM, Kirill Korotaev wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Can you please run the following command:
>>>>>># vzclt exec 110 strace -f -o /tmp/out apt-get install exim4
>>>>>>and send me /tmp/out file (it will be created inside VE)?
>>>>>>
>>>>>>Thanks,
>>>>>>Kirill
>>>>>>P.S. it may require installing strace package first.
>>>>>>
>>>>>>Steve Hodges wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>I'm trying to script the creation of a number of VEs. The template is a
>>>>>>>minimal Debian Etch.
>>>>>>>
>>>>>>>part of what I'm trying to do is thinks like:
>>>>>>>
>>>>>>>vzctl exec 110 apt-get install exim4
>>>>>>>
>>>>>>>exim is one of those packages that wants to run dpkg-configure as part
>>>>>>>of the install (actually I think it's dpkg-preconfigure, but it's the
>>>>>>>same sort of thing)
>>>>>>>
>>>>>>>When it gets to that stage it complains that it "can't re-open stdin"
>>>>>>>and generally fails to complete the install.
>>>>>>>
>>>>>>>Is there any way of executing a whole series of commands like this
>>>>>>>without having to run them all manually. Some things have to be done
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>>from outside the VE too, so just running a script in the VE is
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>problematic :-(
>>>>>>>
>>>>>>>Steve
Re: Scripting ve creation [message #15445 is a reply to message #15440] Tue, 31 July 2007 12:27 Go to previous message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

From: openvz.org
It might be a stupid question, but is that problem caused by the simple
fact that there's no terminal created during vzctl exec -- so everything
that requires a terminal (for example, any ncurses/slang-based
application like top) fails.

Possible solution would be to implement execterm command or the like,
which is the same as exec but with a terminal.

Kirill Korotaev wrote:
> Steve,
>
> Good to know. Anyway I've created a bug
> http://bugzilla.openvz.org/show_bug.cgi?id=658
> so we'll try to reproduce and resolve your issue.
>
> Thanks,
> Kirill
>
> Steve Hodges wrote:
>
>> We have a suitable workaround now. Instead of the creation script
>> running all the installs etc, it writes to an install script in the VE.
>> We then log in to the skeleton VE and run the script.
>>
>> Steve
>>
>>
>>>>> hm... something went differently and there is no such a message
>>>>> in strace :/
>>>>>
>>>>> can you give me an access to the node to check it?
>>>>>
>>>>> Thanks,
>>>>> Kirill
>>>>>
>>>>>
>>>>> Steve Hodges wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> The file is on my web server
>>>>>>
>>>>>> http://steve-is-mucking-about.sexypenguins.com/out.gz
>>>>>>
>>>>>> I noticed that the command did not terminate and had to be killed (I
>>>>>> tried it a number of times with the same result)
>>>>>>
>>>>>> the command I used was
>>>>>>
>>>>>> vzctl exec 101 strace -f -o /tmp/out apt-get install exim4 -y
>>>>>>
>>>>>> thanks
>>>>>>
>>>>>> Steve
>>>>>>
>>>>>> On 27/07/2007 9:56 PM, Kirill Korotaev wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Can you please run the following command:
>>>>>>> # vzclt exec 110 strace -f -o /tmp/out apt-get install exim4
>>>>>>> and send me /tmp/out file (it will be created inside VE)?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Kirill
>>>>>>> P.S. it may require installing strace package first.
>>>>>>>
>>>>>>> Steve Hodges wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> I'm trying to script the creation of a number of VEs. The template is a
>>>>>>>> minimal Debian Etch.
>>>>>>>>
>>>>>>>> part of what I'm trying to do is thinks like:
>>>>>>>>
>>>>>>>> vzctl exec 110 apt-get install exim4
>>>>>>>>
>>>>>>>> exim is one of those packages that wants to run dpkg-configure as part
>>>>>>>> of the install (actually I think it's dpkg-preconfigure, but it's the
>>>>>>>> same sort of thing)
>>>>>>>>
>>>>>>>> When it gets to that stage it complains that it "can't re-open stdin"
>>>>>>>> and generally fails to complete the install.
>>>>>>>>
>>>>>>>> Is there any way of executing a whole series of commands like this
>>>>>>>> without having to run them all manually. Some things have to be done
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> >from outside the VE too, so just running a script in the VE is
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> problematic :-(
>>>>>>>>
>>>>>>>> Steve
>>>>>>>> _______________________________________________
>>>>>>>>
Previous Topic: openvz with latest stable kernel release
Next Topic: openvz and 2.6.20
Goto Forum:
  


Current Time: Wed Jul 24 04:49:03 GMT 2019