* Optionally you can set containers completely stop when service stops at /etc/vz/vz.conf
VE_STOP_MODE=stop
== Patch VarLock directory creation ==
This is necessary to vzeventd works on boot, due to it doesn't automatically create VARLOCK directory on startup:
Lines="$(cat /etc/init.d/vzeventd | grep -e '#.*INIT INFO' -ie '# .*Provides:' -ie '^# .*-St')"
Lines="$(echo "$Lines" | sed -e 's|vzeventd$|vzevent_pre|g' | sed -e 's| vz$| vzeventd|g')"
echo "$Lines" | sudo tee /etc/init.d/vzevent_pre
echo 'mkdir -p /var/lock/subsys' | sudo tee -a /etc/init.d/vzevent_pre
sudo chmod +x /etc/init.d/vzevent_pre
sudo insserv --default vzevent_pre
= '''Reboot into OpenVZ kernel''' =