mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 09:05:44 +00:00
execute: try /lxc.init.static as last resort
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
2322903baa
commit
041cb4999b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user