Merge branch 'tianon-separate-dockerinit' into dm

Conflicts:
	runtime_test.go
diff --git a/container.go b/container.go
index 5466640..c94cae3 100644
--- a/container.go
+++ b/container.go
@@ -1096,7 +1096,7 @@
 	container.NetworkSettings = &NetworkSettings{}
 }
 
-// FIXME: replace this with a control socket within docker-init
+// FIXME: replace this with a control socket within dockerinit
 func (container *Container) waitLxc() error {
 	for {
 		output, err := exec.Command("lxc-info", "-n", container.ID).CombinedOutput()
diff --git a/dockerinit/dockerinit.go b/dockerinit/dockerinit.go
new file mode 100644
index 0000000..0c363f4
--- /dev/null
+++ b/dockerinit/dockerinit.go
@@ -0,0 +1,16 @@
+package main
+
+import (
+	"github.com/dotcloud/docker/sysinit"
+)
+
+var (
+	GITCOMMIT string
+	VERSION   string
+)
+
+func main() {
+	// Running in init mode
+	sysinit.SysInit()
+	return
+}
diff --git a/lxc_template.go b/lxc_template.go
index 0e2dfaf..3faea04 100644
--- a/lxc_template.go
+++ b/lxc_template.go
@@ -92,7 +92,7 @@
 #lxc.mount.entry = varlock {{$ROOTFS}}/var/lock tmpfs size=1024k,nosuid,nodev,noexec 0 0
 lxc.mount.entry = shm {{$ROOTFS}}/dev/shm tmpfs size=65536k,nosuid,nodev,noexec 0 0
 
-# Inject docker-init
+# Inject dockerinit
 lxc.mount.entry = {{.SysInitPath}} {{$ROOTFS}}/.dockerinit none bind,ro 0 0
 
 # In order to get a working DNS environment, mount bind (ro) the host's /etc/resolv.conf into the container
diff --git a/runtime.go b/runtime.go
index 5452a79..24c1b1a 100644
--- a/runtime.go
+++ b/runtime.go
@@ -56,10 +56,10 @@
 	} else {
 		selfPath := utils.SelfPath()
 
-		// If we have a separate docker-init, use that, otherwise use the
+		// If we have a separate dockerinit, use that, otherwise use the
 		// main docker binary
 		dir := filepath.Dir(selfPath)
-		dockerInitPath := filepath.Join(dir, "docker-init")
+		dockerInitPath := filepath.Join(dir, "dockerinit")
 		if _, err := os.Stat(dockerInitPath); err != nil {
 			sysInitPath = selfPath
 		} else {
diff --git a/sysinit/sysinit.go b/sysinit/sysinit.go
index 6b2591f..929a3f6 100644
--- a/sysinit/sysinit.go
+++ b/sysinit/sysinit.go
@@ -95,7 +95,7 @@
 // up the environment before running the actual process
 func SysInit() {
 	if len(os.Args) <= 1 {
-		fmt.Println("You should not invoke docker-init manually")
+		fmt.Println("You should not invoke dockerinit manually")
 		os.Exit(1)
 	}
 	var u = flag.String("u", "", "username or uid")