[sandbox PATCH 3/3] Do not run a shell within a lxc container by default.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Dan Walsh <dwalsh@xxxxxxxxxx>

We want to make sure we use as little overhead as possible.
If a user connects to a lxc container, it will be the same as executing
a shell within the container.
---
 bin/virt-sandbox-service | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
index dd30993..4d2d1cd 100755
--- a/bin/virt-sandbox-service
+++ b/bin/virt-sandbox-service
@@ -271,7 +271,8 @@ class Container:
 
     def create(self):
         self.connect()
-        self.config.set_shell(True)
+        if self.uri != "lxc:///":
+            self.config.set_shell(True)
         if not os.path.exists(self.dest):
             os.mkdir(self.dest)
 
@@ -843,6 +844,18 @@ def stop(args):
              "-S", args.name)
 
 def connect(args):
+    if args.uri == "lxc:///":
+        class Args:
+            command = []
+            noseclabel = None
+            name = args.name
+            uri = args.uri
+
+        args = Args()
+        args.command = [ "/bin/sh" ]
+        execute(args)
+        return
+
     print """\
 Connected to %s.
 Type 'Ctrl + ]' to detach from the console.
-- 
1.8.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]