[Lxc-users] How to execute smbtorture command using lxc-execute?

Greg Kurz gkurz at fr.ibm.com
Fri Nov 4 09:04:18 UTC 2011


On Fri, 2011-11-04 at 11:04 +0530, nishant mungse wrote:
> On Thu, Nov 3, 2011 at 6:36 PM, Greg Kurz <gkurz at fr.ibm.com> wrote:
>         On Thu, 2011-11-03 at 17:07 +0530, nishant mungse wrote:
>         > Hi Greg,
>         >
>         > I have one more doubt regarding lxc containers.
>         >
>         > command::
>         >  lxc-execute -n ubuntu_user -f /home/nishant/ubuntu.conf  --
>         useradd
>         > -c "base_system" -m -p base_system base
>         >
>         > Will this create a new user in base container or on my host
>         system?
>         
>         
>         No. lxc-execute(1) is dedicated to run application containers
>         with
>         limited isolation. At this time, application containers share
>         the user
>         namespace with the host (AKA. lxc-execute doesn't pass
>         CLONE_NEWUSER to
>         clone(2)).
>         
>         > I am asking this question because when I execute this
>         command
>         > directory named base_system is created on my host system,
>         but I want
>         > it to create it on my base container because I want to to
>         smbtorture
>         > tests on many containers.
>         >
>         > How should I do this?
>         
>         
>         Since all application containers use the host user namespace,
>         once the
>         user is created, it's available for all containers... do you
>         have a
>         problem with that ?
>         
>         
>  This means it will not create a directory in /home of containers.  
>  And it will not create a entry in /etc/group of container. 
>  Is this right?

Application containers remount the host filesystems (except /proc
and /dev/shm): useradd will create a user directory in /home and modify
appropriate files in /etc.

Let me clarify: application containers share the user namespace and most
of the filesystem with the host. You don't even have to run useradd in a
container. Just run it on your host and it will be available for all
containers.

>  
>         > Please help me ASAP.
>         
>         
>         > Thanks and Regards,
>         > Nishant Mungse
>         >
>         >
>         > On Thu, Nov 3, 2011 at 4:44 PM, nishant mungse
>         > <nishantmungse at gmail.com> wrote:
>         >         Hi Greg,
>         >
>         >         Thanks 4 reply. It is working now. Thanks
>         >
>         >         Regards,
>         >         Nishant Mungse
>         >
>         >         On Thu, Nov 3, 2011 at 3:41 PM, Greg Kurz
>         <gkurz at fr.ibm.com>
>         >         wrote:
>         >                 On Thu, 2011-11-03 at 11:25 +0530, nishant
>         mungse
>         >                 wrote:
>         >                 > Hi,
>         >                 >
>         >                 > I am using lxc-execute command and in
>         place of
>         >                 command to execute i am
>         >                 > using bin/smbtorture //nishant/ubuntu
>         -Uubuntu_user%
>         >                 passwd raw.write
>         >                 > test.
>         >                 >
>         >                 > command::
>         >                 > lxc-execute -n ubuntu_user
>         >                 > -f /home/nishant/ubuntu.conf
>         >
>          /home/nishant/Desktop/samba-4.0.0alpha15/bin/smbtorture //localhost/ubuntu  -Uubuntu_user%npasswd raw.write
>         >                 >
>         >                 > o/p
>         >                 > lxc-execute: invalid option -- 'U'
>         >                 >
>         >                 >
>         >                 > It is not recognizing this -U option which
>         is
>         >                 required in case of
>         >                 > smbtorture.
>         >                 >
>         >                 > Can anyone plz tell me how to execute such
>         command
>         >                 on containers?
>         >
>         >
>         >
>         >                 You need to insert -- before the command to
>         execute so
>         >                 that lxc doesn't
>         >                 try to parse the remaining command line
>         arguments:
>         >
>         >                 lxc-execute -n ubuntu_user
>         >                 -f /home/nishant/ubuntu.conf -- smbtorture
>         >
>         >                 Cheers.
>         >
>         >                 --
>         >                 Gregory Kurz
>         >                 gkurz at fr.ibm.com
>         >                 Software Engineer @ IBM/Meiosys
>         >                  http://www.ibm.com
>         >                 Tel +33 (0)534 638 479
>         Fax
>         >                 +33 (0)561 400 420
>         >
>         >                 "Anarchy is about taking complete
>         responsibility for
>         >                 yourself."
>         >                        Alan Moore.
>         >
>         >
>         >
>         >
>         
>         --
>         Gregory Kurz
>         gkurz at fr.ibm.com
>         Software Engineer @ IBM/Meiosys
>          http://www.ibm.com
>         Tel +33 (0)534 638 479                           Fax +33
>         (0)561 400 420
>         
>         "Anarchy is about taking complete responsibility for
>         yourself."
>                Alan Moore.
>         
>         
> 

-- 
Gregory Kurz                                     gkurz at fr.ibm.com
Software Engineer @ IBM/Meiosys                  http://www.ibm.com
Tel +33 (0)534 638 479                           Fax +33 (0)561 400 420

"Anarchy is about taking complete responsibility for yourself."
        Alan Moore.





More information about the lxc-users mailing list