mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
@@ -150,16 +150,6 @@ func UseSystemd() bool {
|
|||||||
return hasStartTransientUnit
|
return hasStartTransientUnit
|
||||||
}
|
}
|
||||||
|
|
||||||
func getIfaceForUnit(unitName string) string {
|
|
||||||
if strings.HasSuffix(unitName, ".scope") {
|
|
||||||
return "Scope"
|
|
||||||
}
|
|
||||||
if strings.HasSuffix(unitName, ".service") {
|
|
||||||
return "Service"
|
|
||||||
}
|
|
||||||
return "Unit"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Manager) Apply(pid int) error {
|
func (m *Manager) Apply(pid int) error {
|
||||||
var (
|
var (
|
||||||
c = m.Cgroups
|
c = m.Cgroups
|
||||||
|
|||||||
@@ -407,16 +407,6 @@ func (c *linuxContainer) NotifyMemoryPressure(level PressureLevel) (<-chan struc
|
|||||||
return notifyMemoryPressure(c.cgroupManager.GetPaths(), level)
|
return notifyMemoryPressure(c.cgroupManager.GetPaths(), level)
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX debug support, remove when debugging done.
|
|
||||||
func addArgsFromEnv(evar string, args *[]string) {
|
|
||||||
if e := os.Getenv(evar); e != "" {
|
|
||||||
for _, f := range strings.Fields(e) {
|
|
||||||
*args = append(*args, f)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fmt.Printf(">>> criu %v\n", *args)
|
|
||||||
}
|
|
||||||
|
|
||||||
// check Criu version greater than or equal to min_version
|
// check Criu version greater than or equal to min_version
|
||||||
func (c *linuxContainer) checkCriuVersion(min_version string) error {
|
func (c *linuxContainer) checkCriuVersion(min_version string) error {
|
||||||
var x, y, z, versionReq int
|
var x, y, z, versionReq int
|
||||||
@@ -881,7 +871,7 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts *
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
n, err = criuClient.Write(data)
|
_, err = criuClient.Write(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -590,7 +590,7 @@ func testPids(t *testing.T, systemd bool) {
|
|||||||
// Enforce a restrictive limit. 64 * /bin/true + 1 * shell should cause this
|
// Enforce a restrictive limit. 64 * /bin/true + 1 * shell should cause this
|
||||||
// to fail reliabily.
|
// to fail reliabily.
|
||||||
config.Cgroups.Resources.PidsLimit = 64
|
config.Cgroups.Resources.PidsLimit = 64
|
||||||
out, ret, err := runContainer(config, "", "/bin/sh", "-c", `
|
out, _, err := runContainer(config, "", "/bin/sh", "-c", `
|
||||||
/bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true |
|
/bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true |
|
||||||
/bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true |
|
/bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true |
|
||||||
/bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true |
|
/bin/true | /bin/true | /bin/true | /bin/true | /bin/true | /bin/true | bin/true | /bin/true |
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ func TestInit(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testBadData := []string{"user", "role:user_r", "type:user_t", "level:s0:c1,c15"}
|
testBadData := []string{"user", "role:user_r", "type:user_t", "level:s0:c1,c15"}
|
||||||
plabel, mlabel, err = InitLabels(testBadData)
|
if _, _, err = InitLabels(testBadData); err == nil {
|
||||||
if err == nil {
|
|
||||||
t.Log("InitLabels Bad Failed")
|
t.Log("InitLabels Bad Failed")
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,3 @@ var (
|
|||||||
specCommand cli.Command
|
specCommand cli.Command
|
||||||
killCommand cli.Command
|
killCommand cli.Command
|
||||||
)
|
)
|
||||||
|
|
||||||
func runAction(*cli.Context) {
|
|
||||||
fatalf("Current OS is not supported yet")
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,16 +12,6 @@ import (
|
|||||||
"github.com/opencontainers/runc/libcontainer"
|
"github.com/opencontainers/runc/libcontainer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// newTty creates a new tty for use with the container. If a tty is not to be
|
|
||||||
// created for the process, pipes are created so that the TTY of the parent
|
|
||||||
// process are not inherited by the container.
|
|
||||||
func newTty(create bool, p *libcontainer.Process, rootuid int, console string) (*tty, error) {
|
|
||||||
if create {
|
|
||||||
return createTty(p, rootuid, console)
|
|
||||||
}
|
|
||||||
return createStdioPipes(p, rootuid)
|
|
||||||
}
|
|
||||||
|
|
||||||
// setup standard pipes so that the TTY of the calling runc process
|
// setup standard pipes so that the TTY of the calling runc process
|
||||||
// is not inherited by the container.
|
// is not inherited by the container.
|
||||||
func createStdioPipes(p *libcontainer.Process, rootuid int) (*tty, error) {
|
func createStdioPipes(p *libcontainer.Process, rootuid int) (*tty, error) {
|
||||||
|
|||||||
@@ -139,15 +139,6 @@ var (
|
|||||||
|
|
||||||
var container libcontainer.Container
|
var container libcontainer.Container
|
||||||
|
|
||||||
func containerPreload(context *cli.Context) error {
|
|
||||||
c, err := getContainer(context)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
container = c
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// loadFactory returns the configured factory instance for execing containers.
|
// loadFactory returns the configured factory instance for execing containers.
|
||||||
func loadFactory(context *cli.Context) (libcontainer.Factory, error) {
|
func loadFactory(context *cli.Context) (libcontainer.Factory, error) {
|
||||||
root := context.GlobalString("root")
|
root := context.GlobalString("root")
|
||||||
|
|||||||
Reference in New Issue
Block a user