OpenVZ Forum


Home » General » Support » reboot a VPS
reboot a VPS [message #796] Thu, 12 January 2006 05:36 Go to next message
galaxy is currently offline  galaxy
Messages: 11
Registered: January 2006
Junior Member
If I type "reboot" in a VPS, it stops the VPS but never restarts.
The same thing happens if I type "init 6". From the hardware node
I see that it is left in the "mounted" state.

If I try to stop a VPS from the HW node, the vzctl command hangs
and never kills off the processes inside the VPS.

I've added some services (mysqld, postfix, named) to the VPS
and set chkconfig appropriately and the services start
when booted and they stop when I type reboot or shutdown
from within the VPS.

Re: reboot a VPS [message #798 is a reply to message #796] Thu, 12 January 2006 09:40 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

What OS template do you use for your VPS?

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: reboot a VPS [message #808 is a reply to message #798] Thu, 12 January 2006 13:44 Go to previous messageGo to next message
galaxy is currently offline  galaxy
Messages: 11
Registered: January 2006
Junior Member
its fedora-core-4

I just noticed that if I give it more time (about 5-10 minutes)
then the reboot does complete. Why does it take so long? How
can it be made to be a more reasonable response time? Its actually
faster to reboot the hardware node.
Re: reboot a VPS [message #809 is a reply to message #808] Thu, 12 January 2006 14:34 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

The thing is, reboot is performed in two stages. First, you run reboot (or init 6) inside a VPS and it gets stopped. Second, there is a cron job that runs every 5 minutes (by default) which sees that VPS needs to be rebooted and start it.

You can change it to be run every minute by editing /etc/cron.d/vpsreboot (just remove /5).


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: reboot a VPS [message #811 is a reply to message #809] Thu, 12 January 2006 15:51 Go to previous messageGo to next message
galaxy is currently offline  galaxy
Messages: 11
Registered: January 2006
Junior Member
Ahh, that helps.

But what about when you issue a "vzctl stop xxx" command?
I just timed it and it takes about 3 minutes (sometimes more),
however if I log into the zone and say "halt" or "reboot"
the VPS stops almost immediately.
Re: reboot a VPS [message #814 is a reply to message #811] Fri, 13 January 2006 09:13 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

That needs to be investigated. Probably there is some problem with init scripts inside a VPS.
All that vzctl stop does it it runs halt inside a VPS, and waits till VPS is stopped.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: reboot a VPS [message #818 is a reply to message #814] Fri, 13 January 2006 15:10 Go to previous messageGo to next message
galaxy is currently offline  galaxy
Messages: 11
Registered: January 2006
Junior Member

If I type "vzctl exec 103 halt", it stops within seconds.
Re: reboot a VPS [message #821 is a reply to message #818] Sun, 15 January 2006 13:11 Go to previous message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Can you run strace -ft vzctl stop xxx and see what happens?

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: Hawking PN652TX PCMCIA support
Next Topic: don't start postfix (postfix/master[11752]: fatal: socket: Cannot allocate memory)
Goto Forum:
  


Current Time: Wed May 08 09:23:37 GMT 2024

Total time taken to generate the page: 0.01450 seconds