OpenVZ Forum


Home » General » Support » How about post-VE-start scripts?
Re: How about post-VE-start scripts? [message #34177 is a reply to message #34168] Thu, 11 December 2008 08:57 Go to previous messageGo to previous message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
You can use /etc/vz/conf/vps.mount & /etc/vz/conf/vps.umount scripts, here is how i've done it:

projsrv3 ~ # cat /etc/vz/conf/vps.mount
#!/bin/bash

if [ -x /vz/root/${VEID}/.cs-chroot.start ]; then
        /vz/root/${VEID}/.cs-chroot.start
        exit $?
fi
projsrv3 ~ # cat /etc/vz/conf/vps.umount
#!/bin/bash

if [ -x /vz/root/${VEID}/.cs-chroot.stop ]; then
        /vz/root/${VEID}/.cs-chroot.stop
        exit $?
fi
projsrv3 ~ # cat /vz/root/103/.cs-chroot.start
#!/bin/bash

mount -n --bind /vz/template/portage $(dirname $0)/usr/portage || exit ${?}
mount -n --bind /vz/template/portage-distfiles $(dirname $0)/usr/portage/distfiles || exit ${?}
mount -n --bind /vz/template/portage-packages $(dirname $0)/usr/portage/packages || exit ${?}
projsrv3 ~ # cat /vz/root/103/.cs-chroot.stop
#!/bin/bash

umount $(dirname $0)/usr/portage/packages
umount $(dirname $0)/usr/portage/distfiles
umount $(dirname $0)/usr/portage
projsrv3 ~ #                                 
 
Read Message
Read Message
Read Message icon14.gif
Previous Topic: Live Migration - Permission denied error
Next Topic: [solved] 32bit binary in 64bit VE
Goto Forum:
  


Current Time: Wed Jul 17 21:27:51 GMT 2024

Total time taken to generate the page: 0.02996 seconds