2013-10-10 10:53:38 +02:00
|
|
|
package sysinit
|
2013-02-13 14:01:44 -08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2014-07-10 19:31:01 +00:00
|
|
|
"os"
|
2014-08-04 11:41:59 -07:00
|
|
|
"runtime"
|
2013-02-13 14:01:44 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
// Sys Init code
|
|
|
|
// This code is run INSIDE the container and is responsible for setting
|
|
|
|
// up the environment before running the actual process
|
|
|
|
func SysInit() {
|
2014-08-04 11:41:59 -07:00
|
|
|
// The very first thing that we should do is lock the thread so that other
|
|
|
|
// system level options will work and not have issues, i.e. setns
|
|
|
|
runtime.LockOSThread()
|
|
|
|
|
2013-02-13 14:01:44 -08:00
|
|
|
if len(os.Args) <= 1 {
|
2013-10-17 23:39:57 -06:00
|
|
|
fmt.Println("You should not invoke dockerinit manually")
|
2013-02-13 14:01:44 -08:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|