LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   [LXC] Slackware 14.1 rc1 - Upgraded host & container (http://www.linuxquestions.org/questions/slackware-14/%5Blxc%5D-slackware-14-1-rc1-upgraded-host-and-container-4175480947/)

Chuck56 10-15-2013 07:23 PM

[LXC] Slackware 14.1 rc1 - Upgraded host & container
 
I've recently converted from running KVM accelerated QEMU guests to LXC containers. I'm running a few containers on my servers and really like the speed and reduced resource usage.

I used the templates provided by ponce on his website http://slackware.ponce.cc/blog/?s=lxc&searchsubmit= to upgrade 1 host and 1 container from slackware64-current 14.1 beta to 14.1 rc1.

After upgrading I've run into changes that have thrown me for a loop. Below is start up output from a non-upgraded container and the upgraded container using the command "screen -S my_name lxc-start -n container_name". Seems like there are changes I need to take into account but need some guidance.

I suspect, at a minimum, there are changes to be made to the rootfs/config file and maybe even the container's fstab but I don't know enough about LXC yet to figure this out.

slackware64-current / 14.1 beta - not upgraded yet

Code:

INIT: version 2.88 booting
Using /etc/random-seed to initialize /dev/urandom.
INIT: Entering runlevel: 3
Going multiuser...
Updating shared library links:  /sbin/ldconfig &
Starting sysklogd daemons:  /usr/sbin/syslogd /usr/sbin/klogd -c 3 -x
Starting RPC portmapper:  /sbin/rpc.portmap
Starting RPC NSM (Network Status Monitor):  /sbin/rpc.statd
Starting OpenSSH SSH daemon:  /usr/sbin/sshd
none on /dev/shm type tmpfs (rw)
Starting dnsmasq:  /usr/sbin/dnsmasq
Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m
Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m

* container my_name started. *

slackware64-current / 14.1 rc1 - after upgrade

Code:

INIT: version 2.88 booting
tmpfs on /run type tmpfs (rw,mode=0755)
mount: cgroup already mounted or /sys/fs/cgroup busy
Setting system time from the hardware clock (UTC): hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
Tue Oct 15 15:58:27 MDT 2013
Testing root filesystem status:  read-write filesystem

*** ERROR: Root partition has already been mounted read-write. Cannot check!

For filesystem checking to work properly, your system must initially mount
the root partition as read only. Please modify your kernel with 'rdev' so that
it does this. If you're booting with LILO, add a line:

  read-only

to the Linux section in your /etc/lilo.conf and type 'lilo' to reinstall it.

If you boot from a kernel on a floppy disk, put it in the drive and type:
  rdev -R /dev/fd0 1

If you boot from a bootdisk, or with Loadlin, you can add the 'ro' flag.

This will fix the problem *AND* eliminate this annoying message. :^)

Press ENTER to continue.
mount: can't find / in /etc/fstab or /etc/mtab
Checking non-root filesystems:
fsck from util-linux 2.21.2
Mounting non-root local filesystems:
none on /dev/shm type tmpfs (rw)
Using /etc/random-seed to initialize /dev/urandom.
INIT: Entering runlevel: 3
Going multiuser...
Updating shared library links:  /sbin/ldconfig &
setterm: $TERM is not defined.
Starting sysklogd daemons:  /usr/sbin/syslogd /usr/sbin/klogd -c 3 -x
Starting RPC portmapper:  /sbin/rpc.portmap
Starting RPC NSM (Network Status Monitor):  /sbin/rpc.statd
Starting OpenSSH SSH daemon:  /usr/sbin/sshd
/etc/rc.d/rc.nfsd: line 22: /sbin/modprobe: No such file or directory
Starting RPC NSM (Network Status Monitor):  /sbin/rpc.statd
Starting NFS server daemons:
  /usr/sbin/exportfs -r
  /usr/sbin/rpc.nfsd 8
  /usr/sbin/rpc.mountd
Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m
Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m

* container my_name started. *


ponce 10-16-2013 01:06 AM

the container creation template patches $ROOT/etc/rc.d/rc.S, $ROOT/etc/rc.d/rc.M and $ROOT/etc/rc.d/rc.6 to allow a clean boot inside of a container: what happened to you is that probably you have overwritten these patched versions when you upgraded your system (sysvinit-scripts has been updated too in the latest days).
if you have a container that still got the old versions of these files the faster solution is to simply overwrite the new ones of the upgraded container with the old taken from there.

maybe I should write a notice about this for who, like you, is willing to use it with -current containers, thanks for the report :)
officially the template supports 14.0 containers (because the minimal template could also change during -current development cycle) and I've not tested yet with 14.1 ones, but I'll do it soon.

Chuck56 10-16-2013 06:45 AM

Quote:

Originally Posted by ponce (Post 5046593)
the container creation template patches $ROOT/etc/rc.d/rc.S, $ROOT/etc/rc.d/rc.M and $ROOT/etc/rc.d/rc.6 to allow a clean boot inside of a container: what happened to you is that probably you have overwritten these patched versions when you upgraded your system (sysvinit-scripts has been updated too in the latest days).

Thanks ponce! That's exactly what happened. I run daily rsnapshots of /etc so the original patched versions of rc.6/rc/M/rc.S where within easy reach. I replaced the files and the container boots as expected again.

I took a look through the /var/lib64/lxc/templates/lxc-slackware as saw the rc.d patches used during lxc-create. I learned a bit more about LXC which makes this a good day.

Now I'm off to understand container memory restrictions. My initial searching tells me it's a cgroup kernel option which is not set in Slackware kernels: # CONFIG_MEMCG is not set. Setting those options is reported to add 15MB to the kernel size which is a lot for non-cgroup users.

ponce 10-16-2013 06:58 AM

I'm not using any memory restrictions ATM (I have my containers on machines with 16/48Gb of RAM), so please report back ;)


All times are GMT -5. The time now is 04:02 PM.