[Bug 1121933] [NEW] umountroot remounts partition readonly when called from libvirt/lxc guest

Hanno Hecker hanno.hecker at zalando.de
Mon Feb 11 11:08:31 UTC 2013


Public bug reported:

When a libvirt/lxc guest resides on a partition, which is not /,
/etc/init.d/umountroot will remount that partition read-only on a
"shutdown -r now" in the guest.

Our current workaround is to use
    grep -zq '^LIBVIRT_LXC_UUID=' /proc/1/environ
    if [ $? -eq 0 ]; then
        echo "LXC Container, not mounting / ro..."
    else
        mount    $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev / 2>/dev/null \
        || mount $MOUNT_FORCE_OPT -n -o remount,ro              dummydev / 2>/dev/null \
        || mount $MOUNT_FORCE_OPT -n -o remount,ro                       /
        ES=$?
        [ "$VERBOSE" = no ] || log_action_end_msg $ES
    fi

# dpkg -l lxc libvirt-bin | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                             Version                      Description
+++-================================-============================-==============================================================================
ii  libvirt-bin                      0.9.8-2ubuntu17.7            programs for the libvirt library
ii  lxc                              0.7.5-3ubuntu66              Linux containers userspace tools
# lsb_release -dr
Description:    Ubuntu 12.04.1 LTS
Release:        12.04

** Affects: sysvinit (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to sysvinit in Ubuntu.
https://bugs.launchpad.net/bugs/1121933

Title:
  umountroot remounts partition readonly when called from libvirt/lxc
  guest

Status in “sysvinit” package in Ubuntu:
  New

Bug description:
  When a libvirt/lxc guest resides on a partition, which is not /,
  /etc/init.d/umountroot will remount that partition read-only on a
  "shutdown -r now" in the guest.

  Our current workaround is to use
      grep -zq '^LIBVIRT_LXC_UUID=' /proc/1/environ
      if [ $? -eq 0 ]; then
          echo "LXC Container, not mounting / ro..."
      else
          mount    $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev / 2>/dev/null \
          || mount $MOUNT_FORCE_OPT -n -o remount,ro              dummydev / 2>/dev/null \
          || mount $MOUNT_FORCE_OPT -n -o remount,ro                       /
          ES=$?
          [ "$VERBOSE" = no ] || log_action_end_msg $ES
      fi

  # dpkg -l lxc libvirt-bin | cat
  Desired=Unknown/Install/Remove/Purge/Hold
  | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
  |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
  ||/ Name                             Version                      Description
  +++-================================-============================-==============================================================================
  ii  libvirt-bin                      0.9.8-2ubuntu17.7            programs for the libvirt library
  ii  lxc                              0.7.5-3ubuntu66              Linux containers userspace tools
  # lsb_release -dr
  Description:    Ubuntu 12.04.1 LTS
  Release:        12.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1121933/+subscriptions




More information about the foundations-bugs mailing list