I've got several VEs, one is for light web server as frontend ( nginx ) and some VE with user's apaches/other stuff ( backends ) One of users wanted to view frontend logs, so i decided to mount dir from FRONTEND to BACKEND. veid 1010 is FRONTEND, and veid 1600 is BACKEND. 1600.mount is: root@nekobus:/etc/vz/conf# cat 1600.mount #!/bin/bash # Mount script to bind-mount /var/something into a VPS [ -f /etc/vz/vz.conf ] || exit 1 [ -f $VE_CONFFILE ] || exit 1 . /etc/vz/vz.conf . $VE_CONFFILE echo -n "mounting nginx logs inside pnoenix..." if [[ -d $NGINX_DIR/var/log/nginx/phoenixlogs ]] then mount --bind $NGINX_DIR/var/log/nginx/phoenixlogs $VE_ROOT/home/phoenix/nginx-logs echo " done" else echo " failed" fi where NGINX_DIR is path to FRONTEND's root ( /var/lib/vz/root/1010/ ) Then I start BACKEND and mount script works, we can see: root@nekobus:/etc/vz/conf# vzctl exec 1600 mount|grep nginx simfs on /home/phoenix/nginx-logs type simfs (rw) root@nekobus:/etc/vz/conf# mount |grep nginx /var/lib/vz/root/1010/var/log/nginx/phoenixlogs on /var/lib/vz/root/1600/home/phoenix/nginx-logs type none (rw,bind) then i stop BACKEND and my umount script is: root@nekobus:/etc/vz/conf# cat 1600.umount #!/bin/bash # Mount script to bind-mount /var/something into a VPS [ -f /etc/vz/vz.conf ] || exit 1 [ -f $VE_CONFFILE ] || exit 1 . /etc/vz/vz.conf . $VE_CONFFILE umount $VE_ROOT/home/phoenix/nginx-logs exit 0 stopping VE: root@nekobus:/etc/vz/conf# vzctl stop 1600 Stopping VE ... VE was stopped umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted VE is unmounted while umount complains, path is unmounted: root@nekobus:/etc/vz/conf# mount|grep nginx|wc -l 0 If i comment out "exit 0" and try to stop VE, i see: root@nekobus:/etc/vz/conf# vzctl stop phoenix Stopping VE ... VE was stopped umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted umount: /var/lib/vz/root/1010/var/log/nginx/phoenixlogs: not mounted Error executing umount script /etc/vz/conf/1600.umount unmounting in manual mode: root@nekobus:/etc/vz/conf# vzctl umount 1600 umount: /var/lib/vz/root/1600/home/phoenix/nginx-logs: not mounted Error executing umount script /etc/vz/conf/1600.umount Hardware node is on Debian Sarge, kernel info: root@nekobus:/etc/vz/conf# cat /proc/version Linux version 2.6.18-028stab031 (root@nekobus) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #1 Fri May 4 01:55:17 MSD 2007 vzctl info: root@nekobus:/etc/vz/conf# vzctl --version vzctl version 3.0.16-1dso2~sarge0
Hello it's known issued. Use 'Search' at the forum and you'll find the answer Vasily.
I have the same problem but I couldn't find a solution on the forum. Which post describes the solution for this issue?
OK, I can't find appropriate posts at the moment either! So I explain the problem once again. The thing is that when you produce mount command on HN (e.g. from 101.mount script), the entry in /etc/mtab on HN appears. Later when VE stops all mount points in VE are umounted automatically even _without_ umount script. But the entry in /etc/mtab is still there! It makes mount a bit crazy... So, you should use `mount -n` in mount script and don't use umount script at all. HTH, Vasily.