env LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
env LXC_DHCP_MAX="253"
env LXC_DHCP_CONFILE=""
-env varrun="/var/run/lxc"
+env varrun="/run/lxc"
env LXC_DOMAIN=""
pre-start script
[], [enable_tests=no])
AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
+# Allow overriding the default runtime dir (/run)
+AC_ARG_WITH([runtime-path],
+ [AC_HELP_STRING(
+ [--with-runtime-path=dir],
+ [runtime directory (default: /run)]
+ )], [], [with_runtime_path=['/run']])
+
# LXC container path, where the containers are actually stored
# This is overridden by an entry in the file called LXCCONF
# (i.e. /etc/lxc/lxc.conf)
[AC_HELP_STRING(
[--with-usernic-db],
[lxc user nic database]
- )], [], [with_usernic_db=['/run/lxc/nics']])
+ )], [], [with_usernic_db=['$(with_runtime_path)/lxc/nics']])
# Rootfs path, where the container mount structure is assembled
AC_ARG_WITH([rootfs-path],
AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
AS_AC_EXPAND(LXCINITDIR, "$libexecdir")
AS_AC_EXPAND(LOGPATH, "$with_log_path")
+AS_AC_EXPAND(RUNTIME_PATH, "$with_runtime_path")
AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
# Check for some standard kernel headers
-DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
-DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
-DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
- -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\"
+ -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \
+ -DRUNTIME_PATH=\"$(RUNTIME_PATH)\"
if ENABLE_APPARMOR
AM_CFLAGS += -DHAVE_APPARMOR
rundir = getenv("XDG_RUNTIME_DIR");
if (geteuid() == 0 || rundir == NULL)
- rundir = "/run";
+ rundir = RUNTIME_PATH;
return rundir;
}
-DLXCPATH=\"$(LXCPATH)\" \
-DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \
-DLXCINITDIR=\"$(LXCINITDIR)\" \
- -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\"
+ -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
+ -DRUNTIME_PATH=\"$(RUNTIME_PATH)\"
if ENABLE_APPARMOR
AM_CFLAGS += -DHAVE_APPARMOR
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "lxc/lxclock.h"
+#include "config.h"
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
exit(1);
}
struct stat sb;
- // we don't create the file until the container is running, so this
- // bit of the test needs to be changed
- //char *pathname = "/run/lock/lxc/var/lib/lxc/" mycontainername;
- char *pathname = "/run/lock/lxc/var/lib/lxc/";
+ char *pathname = RUNTIME_PATH "/lock/lxc/var/lib/lxc/";
ret = stat(pathname, &sb);
if (ret != 0) {
fprintf(stderr, "%d: filename %s not created\n", __LINE__,
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+# This test assumes an Ubuntu host
+
if [ $(id -u) -ne 0 ]; then
echo 'run as root'
exit 1
run_cmd lxc-stop -n c1 -k
pkill -u $(id -u $TUSER) -9
- sed -i '/lxcunpriv/d' /var/run/lxc/nics /etc/lxc/lxc-usernet
+ sed -i '/lxcunpriv/d' /run/lxc/nics /etc/lxc/lxc-usernet
sed -i '/^lxcunpriv:/d' /etc/subuid /etc/subgid
rm -Rf $HDIR /run/user/$(id -u $TUSER)
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+# This test assumes an Ubuntu host
+
DONE=0
LXC_USER_NIC="@LIBEXECDIR@/lxc/lxc-user-nic"
lxc-stop -n usernic-c1 -k
lxc-destroy -n usernic-c1
- sed -i '/usernic-user/d' /var/run/lxc/nics /etc/lxc/lxc-usernet
+ sed -i '/usernic-user/d' /run/lxc/nics /etc/lxc/lxc-usernet
ifconfig usernic-br0 down
ifconfig usernic-br1 down
brctl delbr usernic-br0