Skip to content

Instantly share code, notes, and snippets.

@duglin
Created January 5, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duglin/be07fcccb5a5f82778b9 to your computer and use it in GitHub Desktop.
Save duglin/be07fcccb5a5f82778b9 to your computer and use it in GitHub Desktop.
diff --git a/libcontainer/standard_init_linux.go b/libcontainer/standard_init_li
index ec10057..7230f0f 100644
--- a/libcontainer/standard_init_linux.go
+++ b/libcontainer/standard_init_linux.go
@@ -109,5 +109,11 @@ func (l *linuxStandardInit) Init() error {
if syscall.Getppid() != l.parentPid {
return syscall.Kill(syscall.Getpid(), syscall.SIGKILL)
}
+
+ // Special case - just sleep forever
+ if len(l.config.Args) == 0 || l.config.Args[0] == "#sleep" {
+ select {}
+ }
+
return system.Execv(l.config.Args[0], l.config.Args[0:], os.Environ())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment