vzctl: introduce vps.create user-defined script

This patch adds an ability to run a custom user-defined script (or binary)
which is executed right after a new container is created.

The script is named VPS_CONF_DIR/vps.create (usually /etc/vz/conf/vps.create)
which is in line with all the other action scripts (such as vps.mount,
vps.umount, $CTID.mount, $CTID.umount, $CTID.start, $CTID.stop).

The idea is somewhat similar to vzctl's own postcreate.sh script but
different:
1. postcreate.sh is system script supplied by vzctl and
   it is not supposed to be modified by a user (in fact such
   mods can be lost after the update).
2. postcreate.sh is not really executed at the very end of CT creation
   but vps.create is.

For obvious reasons there is no "local" (i.e. $CTID.create) script since,
naturally, a container is not yet exist on that stage so there's no CTID.

Still need to document this functionality in man page (as well as other
action scripts) -- this will be done later (see bug #1273,
http://bugzilla.openvz.org/1273)

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2 files changed