When calling lxc-create, if the template exists but is not executable, we end with the following error messages which make believe that the template file does not exist when it is merely a execute access problem:
lxc-create: ctn00: utils.c: get_template_path: 918 No such file or directory - bad template: /.../lxc-busybox
lxc-create: ctn00: lxccontainer.c: do_lxcapi_create: 1786 Unknown template "/.../lxc-busybox"
lxc-create: ctn00: tools/lxc_create.c: main: 327 Failed to create container ctn00
Actually internally the errno is lost as the following code triggers a useless access to (strace output):
access("/.../lxc-busybox", X_OK) = -1 ENOENT (No such file or directory)
With the above fix, we get a more explicit error message when the template file is missing the "execute" bit:
lxc-create: bbc: utils.c: get_template_path: 917 Permission denied - Bad template pathname: /tmp/azerty
lxc-create: bbc: lxccontainer.c: do_lxcapi_create: 1816 Unknown template "/tmp/azerty"
lxc-create: bbc: tools/lxc_create.c: main: 331 Failed to create container bbc
With the above fix, we get a more explicit error message when the pathname of the template file is incorrect:
lxc-create: bbc: utils.c: get_template_path: 917 No such file or directory - Bad template pathname: /tmp/qwerty
lxc-create: bbc: lxccontainer.c: do_lxcapi_create: 1816 Unknown template "/tmp/qwerty"
lxc-create: bbc: tools/lxc_create.c: main: 331 Failed to create container bbc
Signed-off-by:
Rachid Koucha <rachid.koucha@gmail.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| cgroups | Loading commit data... | |
| cmd | Loading commit data... | |
| lsm | Loading commit data... | |
| pam | Loading commit data... | |
| storage | Loading commit data... | |
| tools | Loading commit data... | |
| Makefile.am | Loading commit data... | |
| af_unix.c | Loading commit data... | |
| af_unix.h | Loading commit data... | |
| attach.c | Loading commit data... | |
| attach.h | Loading commit data... | |
| attach_options.h | Loading commit data... | |
| caps.c | Loading commit data... | |
| caps.h | Loading commit data... | |
| commands.c | Loading commit data... | |
| commands.h | Loading commit data... | |
| commands_utils.c | Loading commit data... | |
| commands_utils.h | Loading commit data... | |
| compiler.h | Loading commit data... | |
| conf.c | Loading commit data... | |
| conf.h | Loading commit data... | |
| confile.c | Loading commit data... | |
| confile.h | Loading commit data... | |
| confile_utils.c | Loading commit data... | |
| confile_utils.h | Loading commit data... | |
| criu.c | Loading commit data... | |
| criu.h | Loading commit data... | |
| error.c | Loading commit data... | |
| error.h | Loading commit data... | |
| execute.c | Loading commit data... | |
| file_utils.c | Loading commit data... | |
| file_utils.h | Loading commit data... | |
| freezer.c | Loading commit data... | |
| initutils.c | Loading commit data... | |
| initutils.h | Loading commit data... | |
| list.h | Loading commit data... | |
| log.c | Loading commit data... | |
| log.h | Loading commit data... | |
| lxc.functions.in | Loading commit data... | |
| lxc.h | Loading commit data... | |
| lxccontainer.c | Loading commit data... | |
| lxccontainer.h | Loading commit data... | |
| lxclock.c | Loading commit data... | |
| lxclock.h | Loading commit data... | |
| lxcseccomp.h | Loading commit data... | |
| macro.h | Loading commit data... | |
| mainloop.c | Loading commit data... | |
| mainloop.h | Loading commit data... | |
| memory_utils.h | Loading commit data... | |
| monitor.c | Loading commit data... | |
| monitor.h | Loading commit data... | |
| namespace.c | Loading commit data... | |
| namespace.h | Loading commit data... | |
| network.c | Loading commit data... | |
| network.h | Loading commit data... | |
| nl.c | Loading commit data... | |
| nl.h | Loading commit data... | |
| parse.c | Loading commit data... | |
| parse.h | Loading commit data... | |
| raw_syscalls.c | Loading commit data... | |
| raw_syscalls.h | Loading commit data... | |
| rexec.c | Loading commit data... | |
| rexec.h | Loading commit data... | |
| ringbuf.c | Loading commit data... | |
| ringbuf.h | Loading commit data... | |
| rtnl.c | Loading commit data... | |
| rtnl.h | Loading commit data... | |
| seccomp.c | Loading commit data... | |
| start.c | Loading commit data... | |
| start.h | Loading commit data... | |
| state.c | Loading commit data... | |
| state.h | Loading commit data... | |
| string_utils.c | Loading commit data... | |
| string_utils.h | Loading commit data... | |
| sync.c | Loading commit data... | |
| sync.h | Loading commit data... | |
| syscall_wrappers.h | Loading commit data... | |
| terminal.c | Loading commit data... | |
| terminal.h | Loading commit data... | |
| utils.c | Loading commit data... | |
| utils.h | Loading commit data... | |
| version.h.in | Loading commit data... |