
Advanced Tasks
71
Rebooting Virtual Private Server
When you issue the
reboot
command at your Linux box console, the command makes the
reboot system call with argument ‘
restart
’, which is passed to the computer BIOS. The
Linux kernel then reboots the computer. For obvious reasons this system call is blocked inside
Virtual Private Servers: no Virtual Private Server can access BIOS directly; otherwise, a reboot
inside a VPS would reboot the whole Hardware Node. That is why the
reboot
command
inside a VPS actually works in a different way. On executing the
reboot
command inside a
VPS, the VPS is stopped and then started by a special script (
/etc/sysconfig/vz-
scripts/vpsreboot
) which is executed periodically (every minute by default) by the cron
daemon. Cron configuration to run the script is in the file
/etc/cron.d/vpsreboot
.
If you want a Virtual Private Server to be unable to initiate reboot itself, add the
ALLOWREBOOT=”no”
line to the Virtual Private Server configuration file
(
/etc/sysconfig/vz-scripts/
vps_id
.conf
). If you want to have VPS reboot
disabled by default and want to specify explicitly which Virtual Private Servers are allowed to
reboot, add the
ALLOWREBOOT=”no”
line to the OpenVZ global configuration file
(
/etc/sysconfig/vz
) and explicitly specify
ALLOWREBOOT=”yes”
in the corresponding
Virtual Private Server configuration files.