mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 06:06:57 +00:00
move lxc-init to /sbin/init.lxc
Using the multiarch dir causes problems when running lxc-execute on amd64 with an i386 container. /sbin/lxc-init is a more confusing name and will show up in 'lxc<tab>'. /sbin/init.lxc should be quite obvious as an init for lxc. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
cd698bdd40
commit
718e4f4842
@ -470,6 +470,7 @@ AC_ARG_WITH([log-path],
|
|||||||
AS_AC_EXPAND(PREFIX, "$prefix")
|
AS_AC_EXPAND(PREFIX, "$prefix")
|
||||||
AS_AC_EXPAND(LIBDIR, "$libdir")
|
AS_AC_EXPAND(LIBDIR, "$libdir")
|
||||||
AS_AC_EXPAND(BINDIR, "$bindir")
|
AS_AC_EXPAND(BINDIR, "$bindir")
|
||||||
|
AS_AC_EXPAND(SBINDIR, "$sbindir")
|
||||||
AS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
|
AS_AC_EXPAND(LIBEXECDIR, "$libexecdir")
|
||||||
AS_AC_EXPAND(INCLUDEDIR, "$includedir")
|
AS_AC_EXPAND(INCLUDEDIR, "$includedir")
|
||||||
AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
|
AS_AC_EXPAND(SYSCONFDIR, "$sysconfdir")
|
||||||
|
@ -121,7 +121,8 @@ AM_CFLAGS=-I$(top_srcdir)/src \
|
|||||||
-DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
|
-DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
|
||||||
-DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
|
-DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
|
||||||
-DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
|
-DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
|
||||||
-DRUNTIME_PATH=\"$(RUNTIME_PATH)\"
|
-DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \
|
||||||
|
-DSBINDIR=\"$(SBINDIR)\"
|
||||||
|
|
||||||
if ENABLE_APPARMOR
|
if ENABLE_APPARMOR
|
||||||
AM_CFLAGS += -DHAVE_APPARMOR
|
AM_CFLAGS += -DHAVE_APPARMOR
|
||||||
@ -198,8 +199,8 @@ bin_PROGRAMS = \
|
|||||||
lxc-usernsexec \
|
lxc-usernsexec \
|
||||||
lxc-wait
|
lxc-wait
|
||||||
|
|
||||||
|
sbin_PROGRAMS = init.lxc
|
||||||
pkglibexec_PROGRAMS = \
|
pkglibexec_PROGRAMS = \
|
||||||
lxc-init \
|
|
||||||
lxc-monitord \
|
lxc-monitord \
|
||||||
lxc-user-nic
|
lxc-user-nic
|
||||||
|
|
||||||
@ -218,7 +219,7 @@ lxc_destroy_SOURCES = lxc_destroy.c
|
|||||||
lxc_execute_SOURCES = lxc_execute.c
|
lxc_execute_SOURCES = lxc_execute.c
|
||||||
lxc_freeze_SOURCES = lxc_freeze.c
|
lxc_freeze_SOURCES = lxc_freeze.c
|
||||||
lxc_info_SOURCES = lxc_info.c
|
lxc_info_SOURCES = lxc_info.c
|
||||||
lxc_init_SOURCES = lxc_init.c
|
init_lxc_SOURCES = lxc_init.c
|
||||||
lxc_monitor_SOURCES = lxc_monitor.c
|
lxc_monitor_SOURCES = lxc_monitor.c
|
||||||
lxc_monitord_SOURCES = lxc_monitord.c
|
lxc_monitord_SOURCES = lxc_monitord.c
|
||||||
lxc_clone_SOURCES = lxc_clone.c
|
lxc_clone_SOURCES = lxc_clone.c
|
||||||
|
@ -38,11 +38,8 @@ struct execute_args {
|
|||||||
int quiet;
|
int quiet;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* historically lxc-init has been under /usr/lib/lxc. Now with
|
/* historically lxc-init has been under /usr/lib/lxc and under
|
||||||
* multi-arch it can be under /usr/lib/$ARCH/lxc. Serge thinks
|
* /usr/lib/$ARCH/lxc. It now lives as $prefix/sbin/init.lxc.
|
||||||
* it makes more sense to put it under /sbin.
|
|
||||||
* If /usr/lib/$ARCH/lxc exists and is used, then LXCINITDIR will
|
|
||||||
* point to it.
|
|
||||||
*/
|
*/
|
||||||
static char *choose_init(void)
|
static char *choose_init(void)
|
||||||
{
|
{
|
||||||
@ -52,6 +49,15 @@ static char *choose_init(void)
|
|||||||
if (!retv)
|
if (!retv)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
ret = snprintf(retv, PATH_MAX, SBINDIR "/init.lxc");
|
||||||
|
if (ret < 0 || ret >= PATH_MAX) {
|
||||||
|
ERROR("pathname too long");
|
||||||
|
goto out1;
|
||||||
|
}
|
||||||
|
ret = stat(retv, &mystat);
|
||||||
|
if (ret == 0)
|
||||||
|
return retv;
|
||||||
|
|
||||||
ret = snprintf(retv, PATH_MAX, LXCINITDIR "/lxc/lxc-init");
|
ret = snprintf(retv, PATH_MAX, LXCINITDIR "/lxc/lxc-init");
|
||||||
if (ret < 0 || ret >= PATH_MAX) {
|
if (ret < 0 || ret >= PATH_MAX) {
|
||||||
ERROR("pathname too long");
|
ERROR("pathname too long");
|
||||||
|
Loading…
Reference in New Issue
Block a user