Subject: Re: [vserver] vserver configuation options
From: Nirmal Guhan <vavatutu@gmail.com>
Date: Fri, 11 Jun 2010 11:55:08 -0700
Fri, 11 Jun 2010 11:55:08 -0700
On Fri, Jun 11, 2010 at 12:56 AM, Corey Wright <undefined@pobox.com> wrote:

> On Thu, 10 Jun 2010 18:51:27 -0700
> Nirmal Guhan <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)
>
> :-)
>

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).

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'

[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
>



On Fri, Jun 11, 2010 at 12:56 AM, Corey Wright <undefined@pobox.com> wrote:
On Thu, 10 Jun 2010 18:51:27 -0700
Nirmal Guhan <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)

:-)

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).

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'

[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