On some cloud images that we are using the host-guest filesystem is not working. When accessed from within the guest it causes processes to be killed after a brief timeout. For now this affects saucy (but it is likely to come back again in Trusty+1 since it's a common issue).
This patch adds a simple check to see if we can really use the /vagrant directory where that filesystem is mounted and provides a helpful message that may offer a work-around. The work around requires a little bit of setup on the host side so it cannot be provided automatically. Signed-off-by: Zygmunt Krynicki <[email protected]> --- support/mk-venv | 28 ++++++++++++++-------------- support/provision-vagrant | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/support/mk-venv b/support/mk-venv index ce5b98b..83f922b 100755 --- a/support/mk-venv +++ b/support/mk-venv @@ -38,6 +38,20 @@ if [ -z "$CHECKBOX_VENV_PATH" ]; then fi fi +# Check if we can create a virtualenv +if [ ! -d $(dirname $CHECKBOX_VENV_PATH) ]; then + echo "E: This script requires $(dirname $CHECKBOX_VENV_PATH) directory to exist" + echo "E: You can use different directory by passing it as argument" + echo "E: For a quick temporary location just pass /tmp/venv" + exit 1 +fi + +# Check if there's one already there +if [ -d $CHECKBOX_VENV_PATH ]; then + echo "E: $CHECKBOX_VENV_PATH seems to already exist" + exit 1 +fi + # Do a sanity check on lsb_release that is missing on Fedora the last time I # had a look at it. if [ "x$(which lsb_release)" = "x" ]; then @@ -85,20 +99,6 @@ fi # Ensure that all Debian dependencies are installed $CHECKBOX_TOP/support/install-deb-dependencies -# Check if we can create a virtualenv -if [ ! -d $(dirname $CHECKBOX_VENV_PATH) ]; then - echo "E: This script requires $(dirname $CHECKBOX_VENV_PATH) directory to exist" - echo "E: You can use different directory by passing it as argument" - echo "E: For a quick temporary location just pass /tmp/venv" - exit 1 -fi - -# Check if there's one already there -if [ -d $CHECKBOX_VENV_PATH ]; then - echo "E: $CHECKBOX_VENV_PATH seems to already exist" - exit 1 -fi - # Create a virtualenv with python3 echo "I: creating virtualbox in $CHECKBOX_VENV_PATH" virtualenv --quiet --system-site-packages --python=/usr/bin/python3 $CHECKBOX_VENV_PATH diff --git a/support/provision-vagrant b/support/provision-vagrant index 4cdeb48..eea8536 100755 --- a/support/provision-vagrant +++ b/support/provision-vagrant @@ -27,6 +27,26 @@ export CHECKBOX_TOP=/vagrant # Make sure that dpkg never stops to have a chat with the user export DEBIAN_FRONTEND=noninteractive +# Vagrant sanity check, see if /vagrant really works. +# +# On various installations of Ubuntu this is not the case as the cloud images +# we depend on seem to have broken virtualbox tools installation inside. This +# causes the filesystem mounted on /vagrant to crash horribly and kill all +# processes attempting to use it. +if ! find /vagrant -mindepth 1 -maxdepth 1 >/dev/null; then + cat <<__EOM__ +E: It seems that /vagrant directory is broken +E: This is a known issue. +E: See this link for a workaround if you have recent-enough VirtualBox: +E: https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1252872 +E: Alternatively you can use NFS on any version of VirtualBox: +E: http://docs.vagrantup.com/v2/synced-folders/nfs.html +__EOM__ + exit 1 +else + echo "I: it seems that /vagrant is working okay" +fi + # Add any necessary PPA repositories $CHECKBOX_TOP/support/install-ppa-dependencies -- 1.8.5.3 -- Mailing list: https://launchpad.net/~checkbox-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~checkbox-dev More help : https://help.launchpad.net/ListHelp

