Commit 041cb499 by Serge Hallyn Committed by Stéphane Graber

execute: try /lxc.init.static as last resort

parent 2322903b
......@@ -104,6 +104,20 @@ static char *choose_init(void)
ret = stat(retv, &mystat);
if (ret == 0)
return retv;
/*
* Last resort, look for the statically compiled init.lxc which we
* hopefully bind-mounted in
*/
ret = snprintf(retv, PATH_MAX, "/init.lxc.static");
if (ret < 0 || ret >= PATH_MAX) {
WARN("Nonsense - name /lxc.init.static too long");
goto out1;
}
ret = stat(retv, &mystat);
if (ret == 0)
return retv;
out1:
free(retv);
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment