*SOLVED* strange mount/umount issues [message #12706] |
Mon, 07 May 2007 15:18 |
coolcold
Messages: 11 Registered: May 2007 Location: Moscow, Russia
|
Junior Member |
|
|
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
[Updated on: Mon, 28 May 2007 11:42] by Moderator Report message to a moderator
|
|
|
|
|
|
|