Browse code

Add proper dockerinit path support for distros that use FHS 2.3

Tianon Gravi authored on 2013/11/28 08:49:40
Showing 1 changed files
... ...
@@ -279,9 +279,16 @@ func DockerInitPath(localCopy string) string {
279 279
 	var possibleInits = []string{
280 280
 		localCopy,
281 281
 		filepath.Join(filepath.Dir(selfPath), "dockerinit"),
282
-		// "/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec."
282
+
283
+		// FHS 3.0 Draft: "/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec."
284
+		// http://www.linuxbase.org/betaspecs/fhs/fhs.html#usrlibexec
283 285
 		"/usr/libexec/docker/dockerinit",
284 286
 		"/usr/local/libexec/docker/dockerinit",
287
+
288
+		// FHS 2.3: "/usr/lib includes object files, libraries, and internal binaries that are not intended to be executed directly by users or shell scripts."
289
+		// http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#USRLIBLIBRARIESFORPROGRAMMINGANDPA
290
+		"/usr/lib/docker/dockerinit",
291
+		"/usr/local/lib/docker/dockerinit",
285 292
 	}
286 293
 	for _, dockerInit := range possibleInits {
287 294
 		path, err := exec.LookPath(dockerInit)