umount script running on mount

wrt54gl

Member
Feb 11, 2011
17
1
23
I am running proxmox 2. When I use the 101.mount script it seems to work well but If I put a 101.mount and a 101.umount script in /etc/vz/conf it tries to run the umount script when the container starts and it fails because the shares are not mounted:

101.mount:

mount -t smbfs -o username=someuser,password=somepass //host.dom.local/share /mnt/share
mount --bind /mnt/share /var/lib/vz/root/101/mnt/share

101.umount:

umount /mnt/share
umount /var/lib/vz/root/101/mnt/share


I do not think that the 101.umount script should run when the container starts.
 
Last edited:
I actually found this answer on Google finally:

The container is not necessarilly unmounted when it is shutdown. When the container is started it is first unmounted and then remounted hence the running 101.umount. All I did was put exit 0 at the end of the 101.umount script.

101.umount:

#!/bin/bash
umount /mnt/share
umount /var/lib/vz/root/101/mnt/share
exit 0