User`s guide
Reference 89
The normal order of executing action scripts is shown in the figure below. The mount and
umount scripts run in the context of the Host OS rather than in the Virtual Private Server.
vzctl mounts
private area
VPS starts
Internal VPS scripts
Normal operations
VPS stops
vzctl dismounts
private area
Execution of global
mount script
Execution of global
umount script
Execution of VPS
mount script
Execution of VPS
umount script
Execution of
start script
Execution of
stop script
Figure 6: Sequence of Executing Action Scripts
It is important to understand how
vzctl handles exit codes of action scripts. If exit code is
non-zero, then
vzctl will try to undo the action for the mount and start scripts. In other
words, if the
start script returns an error, then vzctl will stop VPS, and if one of the
mount scripts fails, then vzctl will dismount the VPS private area. Please note that in this
case
vzctl will not execute the stop and umount scripts at all.
Caution: When executing
vzctl start, both mount and start scripts run. However, if
the start script fails then neither stop nor umount scripts will run. As a result, vzctl
might be unable to dismount the VPS private area, if you set up additional mounts in the
mount
scripts and dismount them in the
umount scripts.
The situation with the
umount and stop scripts is similar. If a script returns an error, then the
action will not be taken. Be careful since this allows to create Virtual Private Servers that are
not stoppable by
vzctl.