OS CentOS 5.1 x86_64
Kernel Version:
ovzkernel-2.6.18-53.1.19.el5.028stab053.14
vzctl version:
vzctl-3.0.22-1
Problem
I have a VPS with id 200 and a script 200.mount to do a bind mount for a file system to a mountpoint in the VPS filespace and another script 200.umount to unmount the filesystem. This is a techniques I have used for some time on an older version of OpenVZ
On starting the VPS it seems that the 200.umount script is being run and the 200.mount script does not get executed. If I rename the 200.umount script and start the VPS then the mount script is called correctly, however on shutdown the filesystem is not unmounted.
running the scripts manually with the VPS active mounts and umounts the filesystem as expected.
Am I doing something wrong? I am basing this on a 3 year old pdf document: "OpenVZ User's Guide" version 2.7.0-8, copyright 2005. Have there been changes to the api? if so is there a more up-to-date version of the User's Guide available?
file 200.mount:
#!/bin/bash
/bin/mount --bind /var/www/docs/ECE /vz/root/200/var/www/ECE/
exit ${?}
file 200.umount:
#!/bin/bash
/bin/umount /vz/root/200/var/www/ECE/
exit ${?}
# vzctl start 200
Starting VE ...
umount: /vz/root/200/var/www/ECE/: not mounted
Error executing umount script /etc/vz/conf/200.umount
Adding IP address(es): xxx.xxx.xxx.xxx
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: eceweb
File resolv.conf was modified
VE start in progress...
# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
# vzctl stop 200
Stopping VE ...
VE was stopped
umount: /vz/root/200/var/www/ECE/: not mounted
Error executing umount script /etc/vz/conf/200.umount
# mv 200.umount 200.umount.1
# vzctl start 200
Starting VE ...
VE is unmounted
VE is mounted
Adding IP address(es): xxx.xxx.xxx.xxx
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: eceweb
File resolv.conf was modified
VE start in progress...
# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/var/www/docs/ECE on /vz/root/200/var/www/ECE type none (rw,bind)