Commit Graph

19 Commits

Author SHA1 Message Date
Andrey Vagin 76d395eff2 new-api: add Console to ProcessConfig
Add ability to execute a process with a specified terminal.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
2015-01-15 18:22:47 +03:00
Andrey Vagin 6dd7552537 new-api: implement fs and systemd cgroup managers
Signed-off-by: Andrey Vagin <avagin@openvz.org>
2015-01-15 00:43:13 +03:00
Andrey Vagin 195a08efbc new-api: set Cloneflags in namespace.Exec()
This place looks more suitable.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-25 18:44:10 +03:00
Andrey Vagin d572094b75 new-api: execute a process inside an existing container
A new constructor function (like nsenter) is added in this patch.  This
function gets arguments from environment variables and its behaviour doesn't
depend on a command line arguments.

A program which calls factory.StartInitialization() must import the nsenter
package. It looks ugly, but I don't know another way how to enter into CT from
a go code.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-25 18:44:10 +03:00
Andrey Vagin 11ce56a9e0 new-api: clean up startInitProcess()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-24 00:19:18 +03:00
Andrey Vagin 13841ef37d new-api: return the Running state only if the init process is alive
Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-23 16:30:37 +03:00
Andrey Vagin 7996829914 libcontainer: optimize updateStateFile()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-19 14:48:15 +03:00
Andrey Vagin 5ecd29c1f2 linux_container: fork an init process in a new set of namespaces
Use namespace.Exec() and namespace.Init() to execute processes in CT.

Now an init process is actually executed in a new container. This series
doesn't change code about creating containers, it only reworks code according
with new API.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-19 14:47:04 +03:00
Andrey Vagin ce9d63376f libcontainer: move State in the configs package
We are going to import the namespaces package into libcontainer,
so libcontainer should not be imported into namespaces.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-19 12:32:34 +03:00
Andrey Vagin 7038ddbc8c libcontainer: move Config in a separate package
We are going to import the namespaces package into libcontainer,
so libcontainer should not be imported into namespaces.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
2014-12-19 12:32:34 +03:00
Andrey Vagin 8e9a6d28d2 linux_container: execute an init process in a new CT
Here is a first step to implement a new API. Currently the init
processes is executed without namespaces and cgroups.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
2014-12-17 07:39:18 +03:00
Andrey Vagin bce773a8c4 linux_container: ct.Destroy() returns error if CT isn't stopped
Signed-off-by: Andrew Vagin <avagin@openvz.org>
2014-12-16 09:19:12 +03:00
Victor Marmol 646ca2ba11 Minor refactorings to fix build.
Signed-off-by: Victor Marmol <vmarmol@google.com>
2014-12-05 17:13:25 -08:00
Victor Marmol e5636543cc Switch from logrus to glog.
Signed-off-by: Victor Marmol <vmarmol@google.com>
2014-12-05 17:06:58 -08:00
Michael Crosby 47b41a6f5d Add logger to container and factory
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-05 15:24:42 -08:00
Michael Crosby d5b8418f75 Remove ContainerInfo interface
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-05 15:24:42 -08:00
Michael Crosby ccb83a1e83 Add cgroup manage for mocking of package resources
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-05 15:24:42 -08:00
Michael Crosby 926ab56ea8 Add testing for linux factory Load
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-05 15:24:42 -08:00
Michael Crosby 6310a958e6 Implement linux factory and container with readonly interface
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-05 15:24:42 -08:00