From: Thierry Parmentelat Date: Fri, 18 Jan 2013 13:40:24 +0000 (+0100) Subject: debian vm's and fix for /var/{lock,run} so the vm can be started X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=963dec8c0f1620a139f23957aaaa8122bcf9dd39;p=infrastructure.git debian vm's and fix for /var/{lock,run} so the vm can be started --- diff --git a/scripts/create-vm-debian.sh b/scripts/create-vm-debian.sh index b10f39d..a05bb09 100755 --- a/scripts/create-vm-debian.sh +++ b/scripts/create-vm-debian.sh @@ -70,13 +70,18 @@ fi $command -### it looks like this is done too early or something -sleep 5 -# with wheezy at least, we need to manually create these 2 directories when trying to vserver start for the first time.. -### post processing for starting up -for dir in run lock; do - echo "Checking for dir /var/$dir ..." - [ -d /vservers/${HOSTNAME}/var/$dir ] || mkdir /vservers/${HOSTNAME}/var/$dir -done +## stolen from vbuild-util-vserver (might be that we can actually use that one as-is...) +# turns out that with wheezy at least, at this point we're getting +# /vservers//var/run -> /run +# /vservers//var/lock -> /run/lock +# trying to fix this with relative links does not appear to work fine +# when trying to vserver start we're then getting +# + exec /usr/sbin/vspace --mount --fs --new -- /usr/sbin/vserver ----nonamespace debuild09 start +# fakerunlevel: open("/var/run/utmp"): No such file or directory +# so instead we bluntly create empty dirs and hope for the best +[ -h /vservers/${HOSTNAME}/var/run ] && [ ! -d /vservers/${HOSTNAME}/var/run ] && \ + { rm -f /vservers/${HOSTNAME}/var/run ; mkdir /vservers/${HOSTNAME}/var/run ; } +[ -h /vservers/${HOSTNAME}/var/lock ] && [ ! -d /vservers/${HOSTNAME}/var/lock ] && \ + { rm -f /vservers/${HOSTNAME}/var/lock ; mkdir /vservers/${HOSTNAME}/var/lock ; } vserver ${HOSTNAME} start