Re: [vserver] vserver configuation options

From: Corey Wright <undefined_at_pobox.com>
Date: Mon 14 Jun 2010 - 17:07:18 BST
Message-Id: <20100614110718.d7ba5ca9.undefined@pobox.com>

On Mon, 14 Jun 2010 09:31:19 +0300
Nikolay Kichukov <hijacker@oldum.net> wrote:

> Hi,
>
> I doubt you are not able to start a guest because of the cgroup
> controller. You should be seeking the problem somewhere else.

i believe that you are incorrect as at line 99 (at least for
0.30.216-pre2864-2) in /usr/lib/util-vserver/vserver.start (the shell
command i believe executed by "vserver <name> start") there's a "set -e".

> Please post
> your util-vserver version + kernel and vserver patch for the time being.

that is helpful to some on the mailing lists (herbert, daniel, and others
more intimately familiar with the history/progress/evolution of
util-vserver), but it wouldn't help me any as i'm generally ignorant (i'm
only partially familiar with the versions in debian releases).

> Thanks,
> - -Nik
>
> Nirmal Guhan wrote:
> > Any help on this? Please help.
> >
> > Thanks,
> > --Nirmal
> >
> > On Fri, Jun 11, 2010 at 11:55 AM, Nirmal Guhan <vavatutu@gmail.com
> > <mailto:vavatutu@gmail.com>> wrote:
> >
> >
> > On Fri, Jun 11, 2010 at 12:56 AM, Corey Wright <undefined@pobox.com
> > <mailto:undefined@pobox.com>> wrote:
> >
> > On Thu, 10 Jun 2010 18:51:27 -0700
> > Nirmal Guhan <vavatutu@gmail.com <mailto:vavatutu@gmail.com>>
> > wrote:
> >
> > > Hi,
> > >
> > > Am just looking at
> > > http://www.nongnu.org/util-vserver/doc/conf/configuration.html
> > to see how
> > > I can modify the cpu and/or memory related parameters. Running
> > into an
> > > error with post-start :
> > >
> > > #vserver newdeb start
> > > Starting enhanced syslogd: rsyslogd.
> > > /usr/local/etc/vservers/newdeb/scripts/post-start: line 1:
> > !/bin/bash: No
> > > such file or directory
> > >
> > > An error occured after executing the vserver startup sequence.
> > This
> > > means that some processes may exist in the created context
> > > and the manual execution of
> > >
> > > /usr/local/sbin/vserver '/usr/local/etc/vservers/newdeb'
> > > stop
> > >
> > > is recommended to fix this.
> > >
> > > # cat post-start
> > > !/bin/bash
> >
> > #!/bin/bash
> >
> > http://en.wikipedia.org/wiki/Shebang_(Unix)
> > <http://en.wikipedia.org/wiki/Shebang_%28Unix%29>
> >
> > :-)
> >
> >
> > Oh! My bad. Nice catch.
> >
> >
> > > echo "In post start"
> > >
> > > #ls /vservers/newdeb/bin/ | grep bash
> > > bash
> > >
> > > Not sure what I am missing!!
> > >
> > > Also, I configured cgroup in /etc/fstab and after restart am
> > not able to
> > > find /dev/cgroup directory at all.
> > >
> > > none /cgroup cgroup
> > defaults 0
> > > 0 (I need this for lxc)
> > > none /dev/cgroup cgroup
> > defaults
> > > 0 0
> > >
> > > # ls -l /dev/cgroup
> > > ls: cannot access /dev/cgroup: No such file or directory
> >
> > mkdir /dev/cgroup
> >
> > or if your /dev is managed by udev, then you probably want to
> > tell udev to
> > create that directory every start-up. see
> > http://linux-vserver.org/util-vserver:Cgroups for how to do it
> > at least
> > under debian lenny (ie "mkdir /lib/udev/devices/cgroup").
> >
> >
> > I had earlier created /dev/cgroup but as it disappeared after
> > reboot. Now I don't see that issue but after the udev suggestion in
> > the above wiki (I use fedora 12 that uses udev).

you need to revisit the url i previously referenced for using cgroups in
linux-vserver. pay specific attention to all mention of "namespaces" and
"ns".

i believe a recent version of util-vserver incorporated code to mount
cgroup without the "ns" subsystem (which i believe the patch/reminder
originated on the mailing list), but that is only relevant if you allow
util-vserver to mount cgroup (and not in /etc/fstab or somewhere else in
the boot process).

you have to either build your kernel without the cgroup ns subsystem or
explicitly mount cgroup without it.

some ways to check for the ns subsystem:
 * grep ^CONFIG_CGROUP_ ${KERNEL_DOT_CONFIG}
 * grep ^ns /proc/cgroups
 * mount | grep cgroup

what the desired output is for the above commands is left as an exercise to
the reader. and how to recompile your kernel without the cgroup "ns"
subsystem or mount /dev/cgroup without it also left to the reader (but can
be found in the aforementioned documentation).

> > I still can't get it to work :-(
> >
> > [root@1-fedora ~]# vserver newdeb start
> > /usr/local/lib/util-vserver/vserver.functions: line 1506:
> > /dev/cgroup/newdeb/tasks: No such file or directory
> >
> >
> > Failed to start vserver 'newdeb'

is this similar to what you are seeing:

<OUTPUT>
# vserver test1 start
/usr/lib/util-vserver/vserver.functions: line
1493: /dev/cgroup/test1/tasks: No such file or directory

Failed to start vserver 'test1'
</OUTPUT>

i was able to generated the above output by unmounting /dev/cgroup on my
test machine, mounting it with all cgroup subsystems, and then trying to
start one of my test vservers.

> >
> > [root@1-fedora ~]# mount | grep cgroup
> > none on /cgroup type cgroup (rw)
> > vserver on /dev/cgroup type cgroup (rw)
> >
> > I do see files under /dev/cgroup.
> >
> > [root@guhan-fedora dev]# ls
> > -l /usr/local/etc/vservers/.defaults/cgroup total 0
> > [root@guhan-fedora dev]# ls -l /lib/udev/devices/cgroup
> > total 0
> >
> > One interesting thing I found is : while /dev/cgroup/newdeb/tasks
> > does not exist, I can see that /dev/cgroup/<pid>/tasks exists where
> > pid "seems" to be the pid of "vserver newdeb start" command.
> >
> > --Nirmal
> >
> >
> >
> >
> > > I can find /cgroup though but looks like vserver would need
> > /dev/cgroup
> > > (atleast I don't find my guest at /cgroup when it is running).
> > >
> > > Please help.
> > >
> > > Thanks,
> > > Nirmal
> > >
> >
> > corey
> > --
> > undefined@pobox.com <mailto:undefined@pobox.com>

in conclusion, please (re)read the documentation i previously and again
currently referenced.

corey

-- 
undefined@pobox.com
Received on Mon Jun 14 17:08:02 2010
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 14 Jun 2010 - 17:08:06 BST by hypermail 2.1.8