As this bug is currently marked as Won't fix, I'll provide a quick
workaround to have a working OpenVZ VE using Karmic for the VE and Hardy
for the host. I'm running it for a few VZ here (mostly NX application
servers on gnome) and it seems to work correctly so far.

Once you have created your VE, create a new file in etc/init/openvz.conf
inside the VE (so, /var/lib/vz/private/<VEID>/etc/init/openvz.conf)
containing what follows:

---

# OpenVZ - Fix init sequence to have OpenVZ working with upstart

description     "Fix OpenVZ"

start on startup

task
pre-start script
    mount -t proc proc /proc
    mount -t devpts devpts /dev/pts
    mount -t sysfs sys /sys
    mount -t tmpfs varrun /var/run
    mount -t tmpfs varlock /var/lock
    mkdir -p /var/run/network
    cat /proc/mounts > /etc/mtab
end script

script
    start networking
    init 2
end script

---

It seems mountall is having a hard time with the way mount points work
during OpenVZ boot sequence, so that init script will mount all the
required mount points, then create /var/run/network as otherwise ifup
won't work (something similar happened with Jaunty), then generate a
clean mtab and finally start networking and switch to runlevel 2 (as
it's not the default runlevel for some reason).

I perfectly know that the above can be considered as a hack and doesn't make 
much use of upstart's capabilities but it will probably make some OpenVZ users 
happy. 
Please feel free to ask for any additional information on how OpenVZ work so we 
can figure out exactly what's wrong and how to have it working out of the box 
as it used to for nearly all previous Ubuntu releases.

If we can't fix it before, I'll be at the UDS so we can discuss/demo it
there to see how we can get upstart+mountall to work correctly in
containers for the next LTS. I hope that Lucid will have OpenVZ host
support as well (depends on upstream support) or a working LXC to
replace OpenVZ so having Ubuntu working inside such containers would be
a good thing to have.

-- 
no /proc/self/mountinfo in an OpenVZ VPS
https://bugs.launchpad.net/bugs/436130
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to