OpenVZ Forum


Home » Mailing lists » Users » VEs and rebooting
VEs and rebooting [message #12734] Tue, 08 May 2007 11:08 Go to next message
pookey is currently offline  pookey
Messages: 12
Registered: March 2007
Junior Member
I'm trying to put together how the VEs are meant to reboot.

I've noticed that there's a /etc/cron.d/vz, which runs

/usr/share/vzctl/scripts/vpsnetclean
and
/usr/share/vzctl/scripts/vpsreboot

My understanding is that vpsreboot should scan for
/vz/private/nnn/reboot, and if it finds that file, it will start the VPS
and delete it the file.

I've looked at the init.d script for rebooting within all of my VEs,
there's a couple of debian ones (3.1 and 4) and a gentoo VE, however
none of these init.d script (be it reboot, or reboot.sh) create the
/reboot file.

These templates were downloaded from the official templates directory.
Is the reboot init script resonsible for creating the file, and if it
is, why doesn't it do it on any of my VPSs? And what is in place to
'fix' the init script should the distro change it during an update?

Thanks,


--
Ian P. Christian ~ http://pookey.co.uk
Re: VEs and rebooting [message #12775 is a reply to message #12734] Wed, 09 May 2007 08:20 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

your understanding is absolutely right.
After switching to runlevel 6 (reboot) in VE /reboot file should be
created. Unfortunately not all official precreated templates produce
this action... If you consider it as a bug - feel free to report it at
bugzilla.openvz.org.

In such "buggy" templates you should manually add init script that will
create /reboot file. During upgrade of VE, your newly added init script
file will not be deleted/modified - so no problem. However the most
clean way is to create a package with this init script and install it
via package system.

Thank you,
Vasily


On Tue, 2007-05-08 at 12:08 +0100, Ian P. Christian wrote:
> I'm trying to put together how the VEs are meant to reboot.
>
> I've noticed that there's a /etc/cron.d/vz, which runs
>
> /usr/share/vzctl/scripts/vpsnetclean
> and
> /usr/share/vzctl/scripts/vpsreboot
>
> My understanding is that vpsreboot should scan for
> /vz/private/nnn/reboot, and if it finds that file, it will start the VPS
> and delete it the file.
>
> I've looked at the init.d script for rebooting within all of my VEs,
> there's a couple of debian ones (3.1 and 4) and a gentoo VE, however
> none of these init.d script (be it reboot, or reboot.sh) create the
> /reboot file.
>
> These templates were downloaded from the official templates directory.
> Is the reboot init script resonsible for creating the file, and if it
> is, why doesn't it do it on any of my VPSs? And what is in place to
> 'fix' the init script should the distro change it during an update?
>
> Thanks,
>
>
Re: VEs and rebooting [message #12777 is a reply to message #12775] Wed, 09 May 2007 09:05 Go to previous messageGo to next message
Gregor Mosheh is currently offline  Gregor Mosheh
Messages: 62
Registered: April 2007
Member
> Ian P. Christian wrote:
>> I've noticed that there's a /etc/cron.d/vz, which runs
>> /usr/share/vzctl/scripts/vpsreboot
>> My understanding is that vpsreboot should scan for
>> /vz/private/nnn/reboot, and if it finds that file, it will start the VPS
>> and delete it the file.

Pardon me if this question sounds dense. I'm looking at the vpsreboot
code, since I'd like to understand everything there is to know about
VZ....

The vpsreboot cronjob runs every 5 minutes. It looks for a /reboot file in
each VE's directory; if it exists and the VE is stopped, it starts the VE.
Sounds good but... what exactly is the point of this functionality?

Is it used as part of the VZ startup sequence, or for watchdogging, ...?

--
HostGIS
Cartographic development and hosting services
707-822-9355
http://www.HostGIS.com/

"Remember that no one cares if you can back up, only if you can restore."
- AMANDA
Re: VEs and rebooting [message #12780 is a reply to message #12777] Wed, 09 May 2007 09:15 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
On Wed, 2007-05-09 at 03:05 -0600, Gregor Mosheh wrote:
> > Ian P. Christian wrote:
> >> I've noticed that there's a /etc/cron.d/vz, which runs
> >> /usr/share/vzctl/scripts/vpsreboot
> >> My understanding is that vpsreboot should scan for
> >> /vz/private/nnn/reboot, and if it finds that file, it will start the VPS
> >> and delete it the file.
>
> Pardon me if this question sounds dense. I'm looking at the vpsreboot
> code, since I'd like to understand everything there is to know about
> VZ....
>
> The vpsreboot cronjob runs every 5 minutes. It looks for a /reboot file in
> each VE's directory; if it exists and the VE is stopped, it starts the VE.
> Sounds good but... what exactly is the point of this functionality?

For example the root of VE performed `reboot` command inside VE. VE will
stop, but somebody from outer world should start it again. vpsreboot is
this somebody, who starts VE if it was rebooted. ;)


>
> Is it used as part of the VZ startup sequence, or for watchdogging, ...?
>
Re: VEs and rebooting [message #12781 is a reply to message #12780] Wed, 09 May 2007 09:23 Go to previous message
Gregor Mosheh is currently offline  Gregor Mosheh
Messages: 62
Registered: April 2007
Member
>> >> I've noticed that there's a /etc/cron.d/vz, which runs
>> >> /usr/share/vzctl/scripts/vpsreboot
>> Sounds good but... what exactly is the point of this functionality?

Vasily Tarasov wrote:
> For example the root of VE performed `reboot` command inside VE. VE will
> stop, but somebody from outer world should start it again. vpsreboot is
> this somebody, who starts VE if it was rebooted. ;)

Ahhh, okay. Running "init 6" in a VE stops the VE's processes and shuts it
down, but has no mechanism of restarting it. Then a few minutes later
vpsreboot boots it back up, simulating the rebooting part of a reboot. Of
course!

Thanks for the explanation; it makes sense now that I have the missing
piece filled in. :)

I'll make a note of this for the template caches I'm creating.
Previous Topic: kernel oops
Next Topic: Logging traffic stats for VEs
Goto Forum:
  


Current Time: Tue May 21 14:21:48 GMT 2024

Total time taken to generate the page: 0.01557 seconds