[Lxc-users] Container shutdown remounts the lxc partition read-only... again

Leonid Isaev lisaev at umail.iu.edu
Sat Jun 22 02:16:39 UTC 2013


On Fri, 21 Jun 2013 09:27:44 -0500
Serge Hallyn <serge.hallyn at ubuntu.com> wrote:

> Quoting Leonid Isaev (lisaev at umail.iu.edu):
> > Hi,
> > 
> > 	I have recently installed vanilla lxc-0.9.0 under archlinux and
> > encountered the old "fs is remounted ro" issue which is supposed to be
> > fixed since https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/942325 ...
> > The (also archlinux) containers' rootfs are located on a separate
> > partition mounted at /var/lib/lxc
> > ----------
> > $ mount | grep lxc
> > /dev/sda3 on /var/lib/lxc type ext4(rw,nosuid,nodev,relatime,data=ordered)
> > ----------
> > The rootfs.hold file is open, according to strace run against lxc-start,
> > e.g.: ----------
> > $ grep hold /var/log/lxc.strace.log
> > open("/var/lib/lxc/arch-LXC-test/rootfs.hold", O_RDWR|O_CREAT, 0600) = 13
> > ----------
> > 
> > Nevertheless, whenever I shutdown the container via lxc-stop,
> > the /var/lib/lxc partition is marked ro... What can I do to determine
> > what's going wrong?
> 
> what fs type are you using for /var/lib/lxc?

Just an ext4.

> 
> I'd try: create a loopback fs with that fstype, mount it under /mnt2,
> then run:
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <fcntl.h>
> 
> cat > holdopen.c << EOF
> int main(int argc, char *argv[]) {
> 	FILE *f = fopen(argv[1], "w");
> 	fprintf(f, "1022\n");
> 	fflush(f);
> 	lockf(fileno(f), F_TLOCK, 0);
> 	sleep(999);
> }
> EOF
> 
> make holdopen
> ./holdopen /mnt2/xxx
> mount -o remount,ro /mnt2/xxx
> 
> and see if it succeeds.

Mount correctly fails saying the FS is busy... After looking at lxc source, I
am very confused because pin_rootfs() in src/conf.c seems to do almost same
thing. I've rebuilt lxc-0.9.0 locally instead of using the packaged one, but
still shutting down the container gives a read-only FS. Can it be related to
the fact that both host and guest run systemd? Also, please note that
lxc-shutdown has no effect as systemd powers off on receiving SIGRTMIN+4 (this
is configured via lxc.stopsignal by the lxc-archlinux template, so lxc-stop
gracefully shuts down the container).

Thanks,
Leonid.

-- 
Leonid Isaev
GnuPG key: 0x164B5A6D
Fingerprint: C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130621/79349e17/attachment.pgp>


More information about the lxc-users mailing list