From ec1609d82928b1753c1016dada03cbccd6b03b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 13 Jun 2014 15:30:24 -0400 Subject: [PATCH] Import lxc_1.0.4.orig.tar.gz --- Makefile.in | 2 +- TODO | 6 - config/apparmor/Makefile.in | 2 +- config/apparmor/abstractions/container-base | 9 +- config/apparmor/container-rules | 9 +- config/apparmor/container-rules.base | 2 + config/init/systemd/Makefile.am | 14 +- config/init/systemd/Makefile.in | 33 +- config/init/systemd/lxc-devsetup | 4 +- config/init/systemd/lxc.service | 8 +- config/init/systemd/lxc.service.in | 17 + config/init/sysvinit/Makefile.in | 9 +- config/init/sysvinit/lxc | 78 ++- config/init/sysvinit/lxc.in | 124 ++++ config/init/upstart/lxc.conf | 32 +- config/yum/Makefile.am | 4 +- config/yum/Makefile.in | 98 ++- config/yum/lxc-patch.py | 21 +- configure | 102 ++- configure.ac | 14 +- doc/ja/common_options.sgml.in | 20 +- doc/ja/legacy/lxc-ls.sgml.in | 12 +- doc/ja/lxc-attach.sgml.in | 104 +-- doc/ja/lxc-autostart.sgml.in | 130 +++- doc/ja/lxc-cgroup.sgml.in | 18 +- doc/ja/lxc-checkconfig.sgml.in | 8 +- doc/ja/lxc-clone.sgml.in | 74 +-- doc/ja/lxc-config.sgml.in | 6 +- doc/ja/lxc-console.sgml.in | 30 +- doc/ja/lxc-create.sgml.in | 68 +- doc/ja/lxc-destroy.sgml.in | 14 +- doc/ja/lxc-device.sgml.in | 14 +- doc/ja/lxc-execute.sgml.in | 30 +- doc/ja/lxc-freeze.sgml.in | 8 +- doc/ja/lxc-info.sgml.in | 30 +- doc/ja/lxc-ls.sgml.in | 30 +- doc/ja/lxc-monitor.sgml.in | 28 +- doc/ja/lxc-snapshot.sgml.in | 22 +- doc/ja/lxc-start-ephemeral.sgml.in | 30 +- doc/ja/lxc-start.sgml.in | 52 +- doc/ja/lxc-stop.sgml.in | 38 +- doc/ja/lxc-top.sgml.in | 28 +- doc/ja/lxc-unfreeze.sgml.in | 4 +- doc/ja/lxc-unshare.sgml.in | 44 +- doc/ja/lxc-user-nic.sgml.in | 26 +- doc/ja/lxc-usernet.sgml.in | 16 +- doc/ja/lxc-usernsexec.sgml.in | 24 +- doc/ja/lxc-wait.sgml.in | 16 +- doc/ja/lxc.conf.sgml.in | 18 +- doc/ja/lxc.container.conf.sgml.in | 674 +++++++++++--------- doc/ja/lxc.sgml.in | 194 +++--- doc/ja/lxc.system.conf.sgml.in | 20 +- doc/lxc-autostart.sgml.in | 76 ++- doc/lxc-clone.sgml.in | 6 +- doc/lxc-create.sgml.in | 9 +- doc/lxc-ls.sgml.in | 2 +- doc/lxc.container.conf.sgml.in | 87 ++- lxc.spec | 3 +- lxc.spec.in | 1 + src/config.h.in | 3 + src/lxc/af_unix.h | 4 + src/lxc/arguments.h | 4 +- src/lxc/attach.c | 39 +- src/lxc/attach.h | 6 +- src/lxc/attach_options.h | 4 +- src/lxc/bdev.c | 80 ++- src/lxc/bdev.h | 19 +- src/lxc/caps.h | 4 +- src/lxc/cgfs.c | 51 +- src/lxc/cgmanager.c | 185 ++++-- src/lxc/cgroup.h | 4 +- src/lxc/commands.c | 4 +- src/lxc/commands.h | 4 +- src/lxc/conf.c | 309 ++++++--- src/lxc/conf.h | 26 +- src/lxc/confile.c | 84 +-- src/lxc/confile.h | 6 +- src/lxc/console.h | 5 + src/lxc/error.h | 4 +- src/lxc/genl.h | 4 +- src/lxc/list.h | 4 +- src/lxc/log.h | 15 +- src/lxc/lxc-ls | 4 + src/lxc/lxc-ls.in | 4 + src/lxc/lxc.h | 4 +- src/lxc/lxc_autostart.c | 335 +++++++--- src/lxc/lxc_create.c | 8 +- src/lxc/lxc_execute.c | 3 + src/lxc/lxc_info.c | 6 +- src/lxc/lxc_start.c | 12 +- src/lxc/lxc_user_nic.c | 10 +- src/lxc/lxccontainer.c | 78 ++- src/lxc/lxccontainer.h | 18 + src/lxc/lxclock.c | 2 + src/lxc/lxclock.h | 4 +- src/lxc/lxcseccomp.h | 3 +- src/lxc/lxcutmp.h | 4 + src/lxc/mainloop.h | 4 +- src/lxc/monitor.c | 4 +- src/lxc/monitor.h | 4 +- src/lxc/namespace.h | 4 +- src/lxc/network.h | 4 +- src/lxc/nl.h | 4 +- src/lxc/parse.h | 4 +- src/lxc/rtnl.h | 4 +- src/lxc/start.c | 22 +- src/lxc/start.h | 4 +- src/lxc/state.h | 4 +- src/lxc/sync.h | 4 +- src/lxc/utils.c | 2 - src/lxc/utils.h | 4 +- src/lxc/version.h | 8 +- src/lxc/version.h.in | 4 +- src/python-lxc/examples/api_test.py | 9 +- src/python-lxc/lxc.c | 21 +- src/python-lxc/lxc/__init__.py | 16 +- src/tests/lxc-test-autostart | 2 + src/tests/lxc-test-unpriv | 2 +- src/tests/lxc-test-usernic | 2 +- src/tests/lxc-test-usernic.in | 2 +- templates/lxc-alpine.in | 1 + templates/lxc-archlinux.in | 4 +- templates/lxc-download.in | 11 +- templates/lxc-fedora.in | 3 +- templates/lxc-oracle.in | 130 ++-- templates/lxc-plamo.in | 4 + templates/lxc-sshd.in | 4 +- 127 files changed, 2812 insertions(+), 1448 deletions(-) delete mode 100644 TODO create mode 100644 config/init/systemd/lxc.service.in mode change 100755 => 100644 config/init/sysvinit/lxc create mode 100644 config/init/sysvinit/lxc.in mode change 100644 => 100755 templates/lxc-archlinux.in diff --git a/Makefile.in b/Makefile.in index 4770280452..54c70243c6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,7 +89,7 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/lxc.pc.in $(srcdir)/lxc.spec.in \ $(top_srcdir)/doc/legacy/lxc-ls.sgml.in \ $(top_srcdir)/doc/ja/legacy/lxc-ls.sgml.in \ - $(top_srcdir)/src/lxc/legacy/lxc-ls.in COPYING TODO \ + $(top_srcdir)/src/lxc/legacy/lxc-ls.in COPYING \ $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/missing diff --git a/TODO b/TODO deleted file mode 100644 index 56d5056986..0000000000 --- a/TODO +++ /dev/null @@ -1,6 +0,0 @@ - - -* create an interactive configuration with the lxc-create command - line, like the 'make menuconfig' of the kernel. - - = lxc-create [-n foo] -m|--menuconfig diff --git a/config/apparmor/Makefile.in b/config/apparmor/Makefile.in index 9bb2802059..9569b30ca3 100644 --- a/config/apparmor/Makefile.in +++ b/config/apparmor/Makefile.in @@ -388,8 +388,8 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@ENABLE_APPARMOR_FALSE@install-data-local: @ENABLE_APPARMOR_FALSE@uninstall-local: +@ENABLE_APPARMOR_FALSE@install-data-local: clean: clean-am clean-am: clean-generic mostlyclean-am diff --git a/config/apparmor/abstractions/container-base b/config/apparmor/abstractions/container-base index c109baad16..71e93487ec 100644 --- a/config/apparmor/abstractions/container-base +++ b/config/apparmor/abstractions/container-base @@ -55,7 +55,7 @@ deny /proc/sys/ker[^n]*{,/**} wklx, deny /proc/sys/kern[^e]*{,/**} wklx, deny /proc/sys/kerne[^l]*{,/**} wklx, - deny /proc/sys/kernel/[^shd]*{,/**} wklx, + deny /proc/sys/kernel/[^smhd]*{,/**} wklx, deny /proc/sys/kernel/d[^o]*{,/**} wklx, deny /proc/sys/kernel/do[^m]*{,/**} wklx, deny /proc/sys/kernel/dom[^a]*{,/**} wklx, @@ -74,7 +74,12 @@ deny /proc/sys/kernel/hostna[^m]*{,/**} wklx, deny /proc/sys/kernel/hostnam[^e]*{,/**} wklx, deny /proc/sys/kernel/hostname?*{,/**} wklx, - deny /proc/sys/kernel/s[^h]*{,/**} wklx, + deny /proc/sys/kernel/m[^s]*{,/**} wklx, + deny /proc/sys/kernel/ms[^g]*{,/**} wklx, + deny /proc/sys/kernel/msg*/** wklx, + deny /proc/sys/kernel/s[^he]*{,/**} wklx, + deny /proc/sys/kernel/se[^m]*{,/**} wklx, + deny /proc/sys/kernel/sem*/** wklx, deny /proc/sys/kernel/sh[^m]*{,/**} wklx, deny /proc/sys/kernel/shm*/** wklx, deny /proc/sys/kernel?*{,/**} wklx, diff --git a/config/apparmor/container-rules b/config/apparmor/container-rules index 2c8c0b494a..ea5c4086f4 100644 --- a/config/apparmor/container-rules +++ b/config/apparmor/container-rules @@ -5,7 +5,7 @@ deny /proc/sys/ker[^n]*{,/**} wklx, deny /proc/sys/kern[^e]*{,/**} wklx, deny /proc/sys/kerne[^l]*{,/**} wklx, - deny /proc/sys/kernel/[^shd]*{,/**} wklx, + deny /proc/sys/kernel/[^smhd]*{,/**} wklx, deny /proc/sys/kernel/d[^o]*{,/**} wklx, deny /proc/sys/kernel/do[^m]*{,/**} wklx, deny /proc/sys/kernel/dom[^a]*{,/**} wklx, @@ -24,7 +24,12 @@ deny /proc/sys/kernel/hostna[^m]*{,/**} wklx, deny /proc/sys/kernel/hostnam[^e]*{,/**} wklx, deny /proc/sys/kernel/hostname?*{,/**} wklx, - deny /proc/sys/kernel/s[^h]*{,/**} wklx, + deny /proc/sys/kernel/m[^s]*{,/**} wklx, + deny /proc/sys/kernel/ms[^g]*{,/**} wklx, + deny /proc/sys/kernel/msg*/** wklx, + deny /proc/sys/kernel/s[^he]*{,/**} wklx, + deny /proc/sys/kernel/se[^m]*{,/**} wklx, + deny /proc/sys/kernel/sem*/** wklx, deny /proc/sys/kernel/sh[^m]*{,/**} wklx, deny /proc/sys/kernel/shm*/** wklx, deny /proc/sys/kernel?*{,/**} wklx, diff --git a/config/apparmor/container-rules.base b/config/apparmor/container-rules.base index 615f01519b..a657481c64 100644 --- a/config/apparmor/container-rules.base +++ b/config/apparmor/container-rules.base @@ -8,6 +8,8 @@ allow /sys/devices/virtual/net/** allow /sys/class/net/** block /proc/sys allow /proc/sys/kernel/shm* +allow /proc/sys/kernel/sem* +allow /proc/sys/kernel/msg* allow /proc/sys/kernel/hostname allow /proc/sys/kernel/domainname allow /proc/sys/net/** diff --git a/config/init/systemd/Makefile.am b/config/init/systemd/Makefile.am index de5ee50089..fc374c5202 100644 --- a/config/init/systemd/Makefile.am +++ b/config/init/systemd/Makefile.am @@ -5,7 +5,17 @@ EXTRA_DIST = \ if INIT_SCRIPT_SYSTEMD SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system -install-systemd: lxc.service lxc-devsetup +lxc-autostart-helper: ../sysvinit/lxc.in $(top_builddir)/config.status + $(AM_V_GEN)sed \ + -e 's|[@]SYSCONFDIR[@]|$(sysconfdir)|g' \ + -e 's|[@]LOCALSTATEDIR[@]|$(localstatedir)|g' \ + -e 's|[@]BINDIR[@]|$(bindir)|g' \ + < $< > $@-t && \ + chmod a+x $@-t && \ + mv $@-t $@ +BUILT_SOURCES = lxc-autostart-helper + +install-systemd: lxc.service lxc-devsetup lxc-autostart-helper $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) $(INSTALL_DATA) lxc.service $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ @@ -13,7 +23,7 @@ uninstall-systemd: rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/lxc.service rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || : -pkglibexec_SCRIPTS = lxc-devsetup +pkglibexec_SCRIPTS = lxc-devsetup lxc-autostart-helper install-data-local: install-systemd uninstall-local: uninstall-systemd diff --git a/config/init/systemd/Makefile.in b/config/init/systemd/Makefile.in index a111a14e16..2de51445a8 100644 --- a/config/init/systemd/Makefile.in +++ b/config/init/systemd/Makefile.in @@ -79,7 +79,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = config/init/systemd -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/lxc.service.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/acinclude.m4 \ $(top_srcdir)/config/tls.m4 $(top_srcdir)/configure.ac @@ -87,7 +88,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = lxc.service CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -306,8 +307,10 @@ EXTRA_DIST = \ lxc.service @INIT_SCRIPT_SYSTEMD_TRUE@SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system -@INIT_SCRIPT_SYSTEMD_TRUE@pkglibexec_SCRIPTS = lxc-devsetup -all: all-am +@INIT_SCRIPT_SYSTEMD_TRUE@BUILT_SOURCES = lxc-autostart-helper +@INIT_SCRIPT_SYSTEMD_TRUE@pkglibexec_SCRIPTS = lxc-devsetup lxc-autostart-helper +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @@ -340,6 +343,8 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +lxc.service: $(top_builddir)/config.status $(srcdir)/lxc.service.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-pkglibexecSCRIPTS: $(pkglibexec_SCRIPTS) @$(NORMAL_INSTALL) @list='$(pkglibexec_SCRIPTS)'; test -n "$(pkglibexecdir)" || list=; \ @@ -413,13 +418,15 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -449,6 +456,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) @INIT_SCRIPT_SYSTEMD_FALSE@install-data-local: @INIT_SCRIPT_SYSTEMD_FALSE@uninstall-local: clean: clean-am @@ -517,7 +525,7 @@ ps-am: uninstall-am: uninstall-local uninstall-pkglibexecSCRIPTS -.MAKE: install-am install-strip +.MAKE: all check install install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ @@ -533,7 +541,16 @@ uninstall-am: uninstall-local uninstall-pkglibexecSCRIPTS uninstall-pkglibexecSCRIPTS -@INIT_SCRIPT_SYSTEMD_TRUE@install-systemd: lxc.service lxc-devsetup +@INIT_SCRIPT_SYSTEMD_TRUE@lxc-autostart-helper: ../sysvinit/lxc.in $(top_builddir)/config.status +@INIT_SCRIPT_SYSTEMD_TRUE@ $(AM_V_GEN)sed \ +@INIT_SCRIPT_SYSTEMD_TRUE@ -e 's|[@]SYSCONFDIR[@]|$(sysconfdir)|g' \ +@INIT_SCRIPT_SYSTEMD_TRUE@ -e 's|[@]LOCALSTATEDIR[@]|$(localstatedir)|g' \ +@INIT_SCRIPT_SYSTEMD_TRUE@ -e 's|[@]BINDIR[@]|$(bindir)|g' \ +@INIT_SCRIPT_SYSTEMD_TRUE@ < $< > $@-t && \ +@INIT_SCRIPT_SYSTEMD_TRUE@ chmod a+x $@-t && \ +@INIT_SCRIPT_SYSTEMD_TRUE@ mv $@-t $@ + +@INIT_SCRIPT_SYSTEMD_TRUE@install-systemd: lxc.service lxc-devsetup lxc-autostart-helper @INIT_SCRIPT_SYSTEMD_TRUE@ $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) @INIT_SCRIPT_SYSTEMD_TRUE@ $(INSTALL_DATA) lxc.service $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ diff --git a/config/init/systemd/lxc-devsetup b/config/init/systemd/lxc-devsetup index 3999ac89dc..e765daf355 100755 --- a/config/init/systemd/lxc-devsetup +++ b/config/init/systemd/lxc-devsetup @@ -2,7 +2,7 @@ # lxc.devsetup - Setup host /dev for container /dev subdirectories. -if [[ ! -d /dev/.lxc ]] +if [ ! -d /dev/.lxc ] then echo "Creating /dev/.lxc" mkdir /dev/.lxc @@ -17,7 +17,7 @@ else mount -t tmpfs tmpfs /dev/.lxc fi -if [[ ! -d /dev/.lxc/user ]] +if [ ! -d /dev/.lxc/user ] then echo "Creating /dev/.lxc/user" mkdir /dev/.lxc/user diff --git a/config/init/systemd/lxc.service b/config/init/systemd/lxc.service index aa20b91fb2..7d3f6914ad 100644 --- a/config/init/systemd/lxc.service +++ b/config/init/systemd/lxc.service @@ -1,13 +1,13 @@ [Unit] Description=LXC Container Initialization and Autoboot Code -After=syslog.target +After=syslog.target network.target [Service] Type=oneshot RemainAfterExit=yes -ExecStartPre=/usr/libexec/lxc/lxc-devsetup -ExecStart=/usr/libexec/lxc/lxc-startup start -ExecStop=/usr/libexec/lxc/lxc-startup stop +ExecStartPre=${exec_prefix}/libexec/lxc/lxc-devsetup +ExecStart=${exec_prefix}/libexec/lxc/lxc-autostart-helper start +ExecStop=${exec_prefix}/libexec/lxc/lxc-autostart-helper stop # Environment=BOOTUP=serial # Environment=CONSOLETYPE=serial StandardOutput=syslog diff --git a/config/init/systemd/lxc.service.in b/config/init/systemd/lxc.service.in new file mode 100644 index 0000000000..5f155b6b08 --- /dev/null +++ b/config/init/systemd/lxc.service.in @@ -0,0 +1,17 @@ +[Unit] +Description=LXC Container Initialization and Autoboot Code +After=syslog.target network.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStartPre=@libexecdir@/lxc/lxc-devsetup +ExecStart=@libexecdir@/lxc/lxc-autostart-helper start +ExecStop=@libexecdir@/lxc/lxc-autostart-helper stop +# Environment=BOOTUP=serial +# Environment=CONSOLETYPE=serial +StandardOutput=syslog +StandardError=syslog + +[Install] +WantedBy=multi-user.target diff --git a/config/init/sysvinit/Makefile.in b/config/init/sysvinit/Makefile.in index 6dcd00dc89..b2142b08d6 100644 --- a/config/init/sysvinit/Makefile.in +++ b/config/init/sysvinit/Makefile.in @@ -78,7 +78,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = config/init/sysvinit -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/lxc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/acinclude.m4 \ $(top_srcdir)/config/tls.m4 $(top_srcdir)/configure.ac @@ -86,7 +87,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = lxc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -305,6 +306,8 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +lxc: $(top_builddir)/config.status $(srcdir)/lxc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tags TAGS: ctags CTAGS: @@ -376,8 +379,8 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@INIT_SCRIPT_SYSV_FALSE@uninstall-local: @INIT_SCRIPT_SYSV_FALSE@install-data-local: +@INIT_SCRIPT_SYSV_FALSE@uninstall-local: clean: clean-am clean-am: clean-generic mostlyclean-am diff --git a/config/init/sysvinit/lxc b/config/init/sysvinit/lxc old mode 100755 new mode 100644 index 09e392235a..1b10afd1d5 --- a/config/init/sysvinit/lxc +++ b/config/init/sysvinit/lxc @@ -13,11 +13,44 @@ # Description: Bring up/down LXC autostart containers ### END INIT INFO +sysconfdir="/usr/local/etc" +bindir="/usr/local/bin" +localstatedir="/usr/local/var" + +# These can be overridden in /usr/local/etc/sysconfig/lxc + +# BOOTGROUPS - What groups should start on bootup? +# Comma separated list of groups. +# Leading comma, trailing comma or embedded double +# comma indicates when the NULL group should be run. +# Example (default): boot the onboot group first then the NULL group +BOOTGROUPS="onboot," + +# SHUTDOWNDELAY - Wait time for a container to shut down. +# ner shutdown can result in lengthy system +# shutdown times. Even 5 seconds per container can be +# too long. +SHUTDOWNDELAY=5 + +# OPTIONS can be used for anything else. +# If you want to boot everything then +# options can be "-a" or "-a -A". +OPTIONS= + +# STOPOPTS are stop options. The can be used for anything else to stop. +# If you want to kill containers fast, use -k +STOPOPTS="-a -s" + # Source function library. -. /etc/init.d/functions +test ! -r "$sysconfdir"/rc.d/init.d/functions || + . "$sysconfdir"/rc.d/init.d/functions + +# Source any configurable options +test ! -r "$sysconfdir"/sysconfig/lxc || + . "$sysconfdir"/sysconfig/lxc # Check for needed utility program -[ -x /usr/bin/lxc-autostart ] || exit 1 +[ -x "$bindir"/lxc-autostart ] || exit 1 # If libvirtd is providing the bridge, it might not be # immediately available, so wait a bit for it before starting @@ -25,15 +58,26 @@ # to start wait_for_bridge() { - [ -f /etc/lxc/default.conf ] || { return 0; } + [ -f "$sysconfdir"/lxc/default.conf ] || { return 0; } - BRNAME=`grep '^[ ]*lxc.network.link' /etc/lxc/default.conf | sed 's/^.*=[ ]*//'` + which ifconfig >/dev/null 2>&1 + if [ $? = 0 ]; then + cmd="ifconfig -a" + else + which ip >/dev/null 2>&1 + if [ $? = 0 ]; then + cmd="ip link list" + fi + fi + [ -n cmd ] || { return 0; } + + BRNAME=`grep '^[ ]*lxc.network.link' "$sysconfdir"/lxc/default.conf | sed 's/^.*=[ ]*//'` if [ -z "$BRNAME" ]; then return 0 fi for try in `seq 1 30`; do - ifconfig -a |grep "^$BRNAME" >/dev/null 2>&1 + eval $cmd |grep "^$BRNAME" >/dev/null 2>&1 if [ $? = 0 ]; then return fi @@ -44,16 +88,30 @@ wait_for_bridge() # See how we were called. case "$1" in start) - [ ! -f /var/lock/subsys/lxc ] || { exit 0; } + [ ! -f "$localstatedir"/lock/subsys/lxc ] || { exit 0; } + + if [ -n "$BOOTGROUPS" ] + then + BOOTGROUPS="-g $BOOTGROUPS" + fi # Start containers wait_for_bridge - action $"Starting LXC containers: " /usr/bin/lxc-autostart - touch /var/lock/subsys/lxc + # Start autoboot containers first then the NULL group "onboot,". + action $"Starting LXC autoboot containers: " /usr/bin/lxc-autostart $OPTIONS $BOOTGROUPS + touch "$localstatedir"/lock/subsys/lxc ;; stop) - action $"Stopping LXC containers: " /usr/bin/lxc-autostart -s - rm -f /var/lock/subsys/lxc + if [ -n "$SHUTDOWNDELAY" ] + then + SHUTDOWNDELAY="-t $SHUTDOWNDELAY" + fi + + # The stop is serialized and can take excessive time. We need to avoid + # delaying the system shutdown / reboot as much as we can since it's not + # parallelized... Even 5 second timout may be too long. + action $"Stopping LXC containers: " "$bindir"/lxc-autostart $STOPOPTS $SHUTDOWNDELAY + rm -f "$localstatedir"/lock/subsys/lxc ;; restart|reload|force-reload) $0 stop diff --git a/config/init/sysvinit/lxc.in b/config/init/sysvinit/lxc.in new file mode 100644 index 0000000000..4bfd0f019f --- /dev/null +++ b/config/init/sysvinit/lxc.in @@ -0,0 +1,124 @@ +#!/bin/sh +# +# lxc Start/Stop LXC autoboot containers +# +# chkconfig: 345 99 01 +# description: Starts/Stops all LXC containers configured for autostart. +# +### BEGIN INIT INFO +# Provides: lxc +# Default-Start: 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Bring up/down LXC autostart containers +# Description: Bring up/down LXC autostart containers +### END INIT INFO + +sysconfdir="@SYSCONFDIR@" +bindir="@BINDIR@" +localstatedir="@LOCALSTATEDIR@" + +# These can be overridden in @SYSCONFDIR@/sysconfig/lxc + +# BOOTGROUPS - What groups should start on bootup? +# Comma separated list of groups. +# Leading comma, trailing comma or embedded double +# comma indicates when the NULL group should be run. +# Example (default): boot the onboot group first then the NULL group +BOOTGROUPS="onboot," + +# SHUTDOWNDELAY - Wait time for a container to shut down. +# ner shutdown can result in lengthy system +# shutdown times. Even 5 seconds per container can be +# too long. +SHUTDOWNDELAY=5 + +# OPTIONS can be used for anything else. +# If you want to boot everything then +# options can be "-a" or "-a -A". +OPTIONS= + +# STOPOPTS are stop options. The can be used for anything else to stop. +# If you want to kill containers fast, use -k +STOPOPTS="-a -s" + +# Source function library. +test ! -r "$sysconfdir"/rc.d/init.d/functions || + . "$sysconfdir"/rc.d/init.d/functions + +# Source any configurable options +test ! -r "$sysconfdir"/sysconfig/lxc || + . "$sysconfdir"/sysconfig/lxc + +# Check for needed utility program +[ -x "$bindir"/lxc-autostart ] || exit 1 + +# If libvirtd is providing the bridge, it might not be +# immediately available, so wait a bit for it before starting +# up the containers or else any that use the bridge will fail +# to start +wait_for_bridge() +{ + [ -f "$sysconfdir"/lxc/default.conf ] || { return 0; } + + which ifconfig >/dev/null 2>&1 + if [ $? = 0 ]; then + cmd="ifconfig -a" + else + which ip >/dev/null 2>&1 + if [ $? = 0 ]; then + cmd="ip link list" + fi + fi + [ -n cmd ] || { return 0; } + + BRNAME=`grep '^[ ]*lxc.network.link' "$sysconfdir"/lxc/default.conf | sed 's/^.*=[ ]*//'` + if [ -z "$BRNAME" ]; then + return 0 + fi + + for try in `seq 1 30`; do + eval $cmd |grep "^$BRNAME" >/dev/null 2>&1 + if [ $? = 0 ]; then + return + fi + sleep 1 + done +} + +# See how we were called. +case "$1" in + start) + [ ! -f "$localstatedir"/lock/subsys/lxc ] || { exit 0; } + + if [ -n "$BOOTGROUPS" ] + then + BOOTGROUPS="-g $BOOTGROUPS" + fi + + # Start containers + wait_for_bridge + # Start autoboot containers first then the NULL group "onboot,". + action $"Starting LXC autoboot containers: " /usr/bin/lxc-autostart $OPTIONS $BOOTGROUPS + touch "$localstatedir"/lock/subsys/lxc + ;; + stop) + if [ -n "$SHUTDOWNDELAY" ] + then + SHUTDOWNDELAY="-t $SHUTDOWNDELAY" + fi + + # The stop is serialized and can take excessive time. We need to avoid + # delaying the system shutdown / reboot as much as we can since it's not + # parallelized... Even 5 second timout may be too long. + action $"Stopping LXC containers: " "$bindir"/lxc-autostart $STOPOPTS $SHUTDOWNDELAY + rm -f "$localstatedir"/lock/subsys/lxc + ;; + restart|reload|force-reload) + $0 stop + $0 start + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|force-reload}" + exit 2 +esac +exit $? diff --git a/config/init/upstart/lxc.conf b/config/init/upstart/lxc.conf index 1a5c5c9969..fae8836814 100644 --- a/config/init/upstart/lxc.conf +++ b/config/init/upstart/lxc.conf @@ -6,6 +6,30 @@ stop on starting rc RUNLEVEL=[016] env LXC_AUTO="false" +# These can be overridden in /etc/default/lxc + +# BOOTGROUPS - What groups should start on bootup? +# Comma separated list of groups. +# Leading comma, trailing comma or embedded double +# comma indicates when the NULL group should be run. +# Example (default): boot the onboot group first then the NULL group +env BOOTGROUPS="onboot," + +# SHUTDOWNDELAY - Wait time for a container to shut down. +# Container shutdown can result in lengthy system +# shutdown times. Even 5 seconds per container can be +# too long. +env SHUTDOWNDELAY=5 + +# OPTIONS can be used for anything else. +# If you want to boot everything then +# options can be "-a" or "-a -A". +env OPTIONS= + +# STOPOPTS are stop options. The can be used for anything else to stop. +# If you want to kill containers fast, use -k +env STOPOPTS="-a -A -s" + pre-start script [ -f /etc/default/lxc ] && . /etc/default/lxc @@ -20,7 +44,13 @@ pre-start script [ "x$LXC_AUTO" = "xtrue" ] || exit 0 - lxc-autostart -L | while read line; do + if [ -n "$BOOTGROUPS" ] + then + BOOTGROUPS="-g $BOOTGROUPS" + fi + + # Process the "onboot" group first then the NULL group. + lxc-autostart -L $OPTIONS $BOOTGROUPS | while read line; do set -- $line (start lxc-instance NAME=$1 && sleep $2) || true done diff --git a/config/yum/Makefile.am b/config/yum/Makefile.am index fb9c3bd3b4..b77ae6fa32 100644 --- a/config/yum/Makefile.am +++ b/config/yum/Makefile.am @@ -1,6 +1,6 @@ yumpluginsdir=$(datadir)/lxc -yumplugins_SCRIPTS = \ +yumplugins_DATA = \ lxc-patch.py -EXTRA_DIST = $(yumplugins_SCRIPTS) +EXTRA_DIST = $(yumplugins_DATA) diff --git a/config/yum/Makefile.in b/config/yum/Makefile.in index 3e7403f5ac..49e60f54c7 100644 --- a/config/yum/Makefile.in +++ b/config/yum/Makefile.in @@ -89,6 +89,25 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -117,26 +136,7 @@ am__uninstall_files_from_dir = { \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(yumpluginsdir)" -SCRIPTS = $(yumplugins_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac +DATA = $(yumplugins_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -302,10 +302,10 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ yumpluginsdir = $(datadir)/lxc -yumplugins_SCRIPTS = \ +yumplugins_DATA = \ lxc-patch.py -EXTRA_DIST = $(yumplugins_SCRIPTS) +EXTRA_DIST = $(yumplugins_DATA) all: all-am .SUFFIXES: @@ -339,40 +339,26 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-yumpluginsSCRIPTS: $(yumplugins_SCRIPTS) +install-yumpluginsDATA: $(yumplugins_DATA) @$(NORMAL_INSTALL) - @list='$(yumplugins_SCRIPTS)'; test -n "$(yumpluginsdir)" || list=; \ + @list='$(yumplugins_DATA)'; test -n "$(yumpluginsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(yumpluginsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(yumpluginsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(yumpluginsdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(yumpluginsdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-yumpluginsSCRIPTS: + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(yumpluginsdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(yumpluginsdir)" || exit $$?; \ + done + +uninstall-yumpluginsDATA: @$(NORMAL_UNINSTALL) - @list='$(yumplugins_SCRIPTS)'; test -n "$(yumpluginsdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ + @list='$(yumplugins_DATA)'; test -n "$(yumpluginsdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(yumpluginsdir)'; $(am__uninstall_files_from_dir) tags TAGS: @@ -413,7 +399,7 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(SCRIPTS) +all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(yumpluginsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ @@ -468,7 +454,7 @@ info: info-am info-am: -install-data-am: install-yumpluginsSCRIPTS +install-data-am: install-yumpluginsDATA install-dvi: install-dvi-am @@ -512,7 +498,7 @@ ps: ps-am ps-am: -uninstall-am: uninstall-yumpluginsSCRIPTS +uninstall-am: uninstall-yumpluginsDATA .MAKE: install-am install-strip @@ -522,11 +508,11 @@ uninstall-am: uninstall-yumpluginsSCRIPTS install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip \ - install-yumpluginsSCRIPTS installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \ - uninstall uninstall-am uninstall-yumpluginsSCRIPTS + install-ps install-ps-am install-strip install-yumpluginsDATA \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-yumpluginsDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/config/yum/lxc-patch.py b/config/yum/lxc-patch.py index 94854f4b90..d639e8425b 100644 --- a/config/yum/lxc-patch.py +++ b/config/yum/lxc-patch.py @@ -5,19 +5,20 @@ # Authors: # Dwight Engen # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. # -# This program is distributed in the hope that it will be useful, +# This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Library General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +# USA # import os diff --git a/configure b/configure index 112cc7f246..9f5fdb70ba 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for lxc 1.0.3. +# Generated by GNU Autoconf 2.69 for lxc 1.0.4. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='lxc' PACKAGE_TARNAME='lxc' -PACKAGE_VERSION='1.0.3' -PACKAGE_STRING='lxc 1.0.3' +PACKAGE_VERSION='1.0.4' +PACKAGE_STRING='lxc 1.0.4' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1431,7 +1431,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lxc 1.0.3 to adapt to many kinds of systems. +\`configure' configures lxc 1.0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1501,7 +1501,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lxc 1.0.3:";; + short | recursive ) echo "Configuration of lxc 1.0.4:";; esac cat <<\_ACEOF @@ -1659,7 +1659,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lxc configure 1.0.3 +lxc configure 1.0.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2124,7 +2124,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lxc $as_me 1.0.3, which was +It was created by lxc $as_me 1.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2595,7 +2595,7 @@ $as_echo "no" >&6; } fi fi -LXC_VERSION_BASE=1.0.3 +LXC_VERSION_BASE=1.0.4 @@ -2603,9 +2603,9 @@ LXC_VERSION_MAJOR=1 LXC_VERSION_MINOR=0 -LXC_VERSION_MICRO=3 +LXC_VERSION_MICRO=4 -LXC_VERSION=1.0.3 +LXC_VERSION=1.0.4 @@ -3126,7 +3126,7 @@ fi # Define the identity of the package. PACKAGE='lxc' - VERSION='1.0.3' + VERSION='1.0.4' cat >>confdefs.h <<_ACEOF @@ -6282,6 +6282,78 @@ fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for get_pid_cgroup_abs_sync" >&5 +$as_echo_n "checking for get_pid_cgroup_abs_sync... " >&6; } +save_LIBS=$LIBS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cgmanager_get_pid_cgroup_abs_sync" >&5 +$as_echo_n "checking for library containing cgmanager_get_pid_cgroup_abs_sync... " >&6; } +if ${ac_cv_search_cgmanager_get_pid_cgroup_abs_sync+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cgmanager_get_pid_cgroup_abs_sync (); +int +main () +{ +return cgmanager_get_pid_cgroup_abs_sync (); + ; + return 0; +} +_ACEOF +for ac_lib in '' cgmanager; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib -lnih -lnih-dbus -ldbus-1 $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_cgmanager_get_pid_cgroup_abs_sync=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_cgmanager_get_pid_cgroup_abs_sync+:} false; then : + break +fi +done +if ${ac_cv_search_cgmanager_get_pid_cgroup_abs_sync+:} false; then : + +else + ac_cv_search_cgmanager_get_pid_cgroup_abs_sync=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cgmanager_get_pid_cgroup_abs_sync" >&5 +$as_echo "$ac_cv_search_cgmanager_get_pid_cgroup_abs_sync" >&6; } +ac_res=$ac_cv_search_cgmanager_get_pid_cgroup_abs_sync +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + have_abs_cgroups=yes +else + have_abs_cgroups=no +fi + +LIBS=$save_LIBS +if test "x$have_abs_cgroups" = "xyes"; then + +$as_echo "#define HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi # Linux capabilities # Check whether --enable-capabilities was given. if test "${enable_capabilities+set}" = set; then : @@ -9059,7 +9131,7 @@ if test "x$GCC" = "xyes"; then fi # Files requiring some variable expansion -ac_config_files="$ac_config_files Makefile lxc.pc lxc.spec config/Makefile config/apparmor/Makefile config/bash/Makefile config/bash/lxc config/init/Makefile config/init/sysvinit/Makefile config/init/systemd/Makefile config/init/upstart/Makefile config/etc/Makefile config/templates/Makefile config/templates/centos.common.conf config/templates/centos.userns.conf config/templates/debian.common.conf config/templates/debian.userns.conf config/templates/fedora.common.conf config/templates/fedora.userns.conf config/templates/gentoo.common.conf config/templates/gentoo.moresecure.conf config/templates/gentoo.userns.conf config/templates/oracle.common.conf config/templates/oracle.userns.conf config/templates/plamo.common.conf config/templates/plamo.userns.conf config/templates/ubuntu-cloud.common.conf config/templates/ubuntu-cloud.lucid.conf config/templates/ubuntu-cloud.userns.conf config/templates/ubuntu.common.conf config/templates/ubuntu.lucid.conf config/templates/ubuntu.userns.conf config/yum/Makefile doc/Makefile doc/api/Makefile doc/legacy/lxc-ls.sgml doc/lxc-attach.sgml doc/lxc-autostart.sgml doc/lxc-cgroup.sgml doc/lxc-checkconfig.sgml doc/lxc-clone.sgml doc/lxc-config.sgml doc/lxc-console.sgml doc/lxc-create.sgml doc/lxc-destroy.sgml doc/lxc-device.sgml doc/lxc-execute.sgml doc/lxc-freeze.sgml doc/lxc-info.sgml doc/lxc-ls.sgml doc/lxc-monitor.sgml doc/lxc-snapshot.sgml doc/lxc-start-ephemeral.sgml doc/lxc-start.sgml doc/lxc-stop.sgml doc/lxc-top.sgml doc/lxc-unfreeze.sgml doc/lxc-unshare.sgml doc/lxc-user-nic.sgml doc/lxc-usernsexec.sgml doc/lxc-wait.sgml doc/lxc.conf.sgml doc/lxc.container.conf.sgml doc/lxc.system.conf.sgml doc/lxc-usernet.sgml doc/lxc.sgml doc/common_options.sgml doc/see_also.sgml doc/rootfs/Makefile doc/examples/Makefile doc/examples/lxc-macvlan.conf doc/examples/lxc-vlan.conf doc/examples/lxc-no-netns.conf doc/examples/lxc-empty-netns.conf doc/examples/lxc-phys.conf doc/examples/lxc-veth.conf doc/examples/lxc-complex.conf doc/ja/Makefile doc/ja/legacy/lxc-ls.sgml doc/ja/lxc-attach.sgml doc/ja/lxc-autostart.sgml doc/ja/lxc-cgroup.sgml doc/ja/lxc-checkconfig.sgml doc/ja/lxc-clone.sgml doc/ja/lxc-config.sgml doc/ja/lxc-console.sgml doc/ja/lxc-create.sgml doc/ja/lxc-destroy.sgml doc/ja/lxc-device.sgml doc/ja/lxc-execute.sgml doc/ja/lxc-freeze.sgml doc/ja/lxc-info.sgml doc/ja/lxc-ls.sgml doc/ja/lxc-monitor.sgml doc/ja/lxc-snapshot.sgml doc/ja/lxc-start-ephemeral.sgml doc/ja/lxc-start.sgml doc/ja/lxc-stop.sgml doc/ja/lxc-top.sgml doc/ja/lxc-unfreeze.sgml doc/ja/lxc-unshare.sgml doc/ja/lxc-user-nic.sgml doc/ja/lxc-usernsexec.sgml doc/ja/lxc-wait.sgml doc/ja/lxc.conf.sgml doc/ja/lxc.container.conf.sgml doc/ja/lxc.system.conf.sgml doc/ja/lxc-usernet.sgml doc/ja/lxc.sgml doc/ja/common_options.sgml doc/ja/see_also.sgml hooks/Makefile templates/Makefile templates/lxc-alpine templates/lxc-altlinux templates/lxc-archlinux templates/lxc-busybox templates/lxc-centos templates/lxc-cirros templates/lxc-debian templates/lxc-download templates/lxc-fedora templates/lxc-gentoo templates/lxc-openmandriva templates/lxc-opensuse templates/lxc-oracle templates/lxc-plamo templates/lxc-sshd templates/lxc-ubuntu templates/lxc-ubuntu-cloud src/Makefile src/lxc/Makefile src/lxc/lxc-checkconfig src/lxc/lxc-ls src/lxc/lxc-start-ephemeral src/lxc/legacy/lxc-ls src/lxc/lxc.functions src/lxc/version.h src/python-lxc/Makefile src/lua-lxc/Makefile src/tests/Makefile src/tests/lxc-test-usernic" +ac_config_files="$ac_config_files Makefile lxc.pc lxc.spec config/Makefile config/apparmor/Makefile config/bash/Makefile config/bash/lxc config/init/Makefile config/init/sysvinit/Makefile config/init/sysvinit/lxc config/init/systemd/Makefile config/init/systemd/lxc.service config/init/upstart/Makefile config/etc/Makefile config/templates/Makefile config/templates/centos.common.conf config/templates/centos.userns.conf config/templates/debian.common.conf config/templates/debian.userns.conf config/templates/fedora.common.conf config/templates/fedora.userns.conf config/templates/gentoo.common.conf config/templates/gentoo.moresecure.conf config/templates/gentoo.userns.conf config/templates/oracle.common.conf config/templates/oracle.userns.conf config/templates/plamo.common.conf config/templates/plamo.userns.conf config/templates/ubuntu-cloud.common.conf config/templates/ubuntu-cloud.lucid.conf config/templates/ubuntu-cloud.userns.conf config/templates/ubuntu.common.conf config/templates/ubuntu.lucid.conf config/templates/ubuntu.userns.conf config/yum/Makefile doc/Makefile doc/api/Makefile doc/legacy/lxc-ls.sgml doc/lxc-attach.sgml doc/lxc-autostart.sgml doc/lxc-cgroup.sgml doc/lxc-checkconfig.sgml doc/lxc-clone.sgml doc/lxc-config.sgml doc/lxc-console.sgml doc/lxc-create.sgml doc/lxc-destroy.sgml doc/lxc-device.sgml doc/lxc-execute.sgml doc/lxc-freeze.sgml doc/lxc-info.sgml doc/lxc-ls.sgml doc/lxc-monitor.sgml doc/lxc-snapshot.sgml doc/lxc-start-ephemeral.sgml doc/lxc-start.sgml doc/lxc-stop.sgml doc/lxc-top.sgml doc/lxc-unfreeze.sgml doc/lxc-unshare.sgml doc/lxc-user-nic.sgml doc/lxc-usernsexec.sgml doc/lxc-wait.sgml doc/lxc.conf.sgml doc/lxc.container.conf.sgml doc/lxc.system.conf.sgml doc/lxc-usernet.sgml doc/lxc.sgml doc/common_options.sgml doc/see_also.sgml doc/rootfs/Makefile doc/examples/Makefile doc/examples/lxc-macvlan.conf doc/examples/lxc-vlan.conf doc/examples/lxc-no-netns.conf doc/examples/lxc-empty-netns.conf doc/examples/lxc-phys.conf doc/examples/lxc-veth.conf doc/examples/lxc-complex.conf doc/ja/Makefile doc/ja/legacy/lxc-ls.sgml doc/ja/lxc-attach.sgml doc/ja/lxc-autostart.sgml doc/ja/lxc-cgroup.sgml doc/ja/lxc-checkconfig.sgml doc/ja/lxc-clone.sgml doc/ja/lxc-config.sgml doc/ja/lxc-console.sgml doc/ja/lxc-create.sgml doc/ja/lxc-destroy.sgml doc/ja/lxc-device.sgml doc/ja/lxc-execute.sgml doc/ja/lxc-freeze.sgml doc/ja/lxc-info.sgml doc/ja/lxc-ls.sgml doc/ja/lxc-monitor.sgml doc/ja/lxc-snapshot.sgml doc/ja/lxc-start-ephemeral.sgml doc/ja/lxc-start.sgml doc/ja/lxc-stop.sgml doc/ja/lxc-top.sgml doc/ja/lxc-unfreeze.sgml doc/ja/lxc-unshare.sgml doc/ja/lxc-user-nic.sgml doc/ja/lxc-usernsexec.sgml doc/ja/lxc-wait.sgml doc/ja/lxc.conf.sgml doc/ja/lxc.container.conf.sgml doc/ja/lxc.system.conf.sgml doc/ja/lxc-usernet.sgml doc/ja/lxc.sgml doc/ja/common_options.sgml doc/ja/see_also.sgml hooks/Makefile templates/Makefile templates/lxc-alpine templates/lxc-altlinux templates/lxc-archlinux templates/lxc-busybox templates/lxc-centos templates/lxc-cirros templates/lxc-debian templates/lxc-download templates/lxc-fedora templates/lxc-gentoo templates/lxc-openmandriva templates/lxc-opensuse templates/lxc-oracle templates/lxc-plamo templates/lxc-sshd templates/lxc-ubuntu templates/lxc-ubuntu-cloud src/Makefile src/lxc/Makefile src/lxc/lxc-checkconfig src/lxc/lxc-ls src/lxc/lxc-start-ephemeral src/lxc/legacy/lxc-ls src/lxc/lxc.functions src/lxc/version.h src/python-lxc/Makefile src/lua-lxc/Makefile src/tests/Makefile src/tests/lxc-test-usernic" ac_config_commands="$ac_config_commands default" @@ -9697,7 +9769,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lxc $as_me 1.0.3, which was +This file was extended by lxc $as_me 1.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9763,7 +9835,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -lxc config.status 1.0.3 +lxc config.status 1.0.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -9904,7 +9976,9 @@ do "config/bash/lxc") CONFIG_FILES="$CONFIG_FILES config/bash/lxc" ;; "config/init/Makefile") CONFIG_FILES="$CONFIG_FILES config/init/Makefile" ;; "config/init/sysvinit/Makefile") CONFIG_FILES="$CONFIG_FILES config/init/sysvinit/Makefile" ;; + "config/init/sysvinit/lxc") CONFIG_FILES="$CONFIG_FILES config/init/sysvinit/lxc" ;; "config/init/systemd/Makefile") CONFIG_FILES="$CONFIG_FILES config/init/systemd/Makefile" ;; + "config/init/systemd/lxc.service") CONFIG_FILES="$CONFIG_FILES config/init/systemd/lxc.service" ;; "config/init/upstart/Makefile") CONFIG_FILES="$CONFIG_FILES config/init/upstart/Makefile" ;; "config/etc/Makefile") CONFIG_FILES="$CONFIG_FILES config/etc/Makefile" ;; "config/templates/Makefile") CONFIG_FILES="$CONFIG_FILES config/templates/Makefile" ;; diff --git a/configure.ac b/configure.ac index 6f8fca52a8..249d99c13d 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ m4_define([lxc_version_major], 1) m4_define([lxc_version_minor], 0) -m4_define([lxc_version_micro], 3) +m4_define([lxc_version_micro], 4) m4_define([lxc_version_beta], []) m4_define([lxc_version_base], [lxc_version_major.lxc_version_minor.lxc_version_micro]) @@ -256,6 +256,16 @@ AM_COND_IF([ENABLE_CGMANAGER], PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) ]) +AC_MSG_CHECKING(for get_pid_cgroup_abs_sync) +save_LIBS=$LIBS +AC_SEARCH_LIBS([cgmanager_get_pid_cgroup_abs_sync], [cgmanager], [have_abs_cgroups=yes], [have_abs_cgroups=no], [-lnih -lnih-dbus -ldbus-1]) +LIBS=$save_LIBS +if test "x$have_abs_cgroups" = "xyes"; then + AC_DEFINE([HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC], 1, [Have cgmanager_get_pid_cgroup_abs_sync]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi # Linux capabilities AC_ARG_ENABLE([capabilities], [AC_HELP_STRING([--enable-capabilities], [enable kernel capabilities support [default=auto]])], @@ -565,7 +575,9 @@ AC_CONFIG_FILES([ config/bash/lxc config/init/Makefile config/init/sysvinit/Makefile + config/init/sysvinit/lxc config/init/systemd/Makefile + config/init/systemd/lxc.service config/init/upstart/Makefile config/etc/Makefile config/templates/Makefile diff --git a/doc/ja/common_options.sgml.in b/doc/ja/common_options.sgml.in index ceefd8dd57..8069ac6aa2 100644 --- a/doc/ja/common_options.sgml.in +++ b/doc/ja/common_options.sgml.in @@ -33,7 +33,7 @@ by KATOH Yasufumi - ここで紹介するオプションは lxc コマンドの大部分で共通のものです. + ここで紹介するオプションは lxc コマンドの大部分で共通のものです。 @@ -44,7 +44,7 @@ by KATOH Yasufumi - 通常より長い使い方のメッセージを表示します. + 通常より長い使い方のメッセージを表示します。 @@ -55,7 +55,7 @@ by KATOH Yasufumi - 使い方を表示します. + 使い方を表示します。 @@ -67,7 +67,7 @@ by KATOH Yasufumi - 出力を抑制します. + 出力を抑制します。 @@ -79,7 +79,7 @@ by KATOH Yasufumi - デフォルトと別のコンテナパスを使用します.デフォルトは @LXCPATH@ です. + デフォルトと別のコンテナパスを使用します。デフォルトは @LXCPATH@ です。 @@ -92,7 +92,7 @@ by KATOH Yasufumi Output to an alternate log FILE. The default is no log. --> - 追加のログを FILE に出力します.デフォルトは出力しません. + 追加のログを FILE に出力します。デフォルトは出力しません。 @@ -110,11 +110,11 @@ by KATOH Yasufumi NOTICE, INFO, DEBUG. --> - ログの優先度を LEVEL に設定します.デフォルトの優先度は ERROR です.以下の値を設定可能です: + ログの優先度を LEVEL に設定します。デフォルトの優先度は ERROR です。以下の値を設定可能です: FATAL, CRIT, WARN, ERROR, NOTICE, INFO, - DEBUG. + DEBUG - このオプションは追加のログファイルへのイベントログの優先度の設定である事に注意してください.stderr への ERROR イベントのログには影響しません. + このオプションは追加のログファイルへのイベントログの優先度の設定である事に注意してください。stderr への ERROR イベントのログには影響しません。 @@ -135,7 +135,7 @@ by KATOH Yasufumi Use container identifier NAME. The container identifier format is an alphanumeric string. --> - NAME という名前でコンテナを識別します.コンテナ識別子のフォーマットは英数字の文字列です. + NAME という名前でコンテナを識別します。コンテナ識別子のフォーマットは英数字の文字列です。 diff --git a/doc/ja/legacy/lxc-ls.sgml.in b/doc/ja/legacy/lxc-ls.sgml.in index 1cf62cad9b..0fdfafd3ed 100644 --- a/doc/ja/legacy/lxc-ls.sgml.in +++ b/doc/ja/legacy/lxc-ls.sgml.in @@ -47,7 +47,7 @@ by KATOH Yasufumi - システム上に存在するコンテナをリスト表示する. + システム上に存在するコンテナをリスト表示する。 @@ -66,7 +66,7 @@ by KATOH Yasufumi lxc-ls list the containers existing on the system. --> - lxc-ls はシステム上に存在するコンテナをリスト表示します. + lxc-ls はシステム上に存在するコンテナをリスト表示します。 @@ -83,7 +83,7 @@ by KATOH Yasufumi - 稼働中のコンテナをリスト表示します. + 稼働中のコンテナをリスト表示します。 @@ -98,7 +98,7 @@ by KATOH Yasufumi The option passed to lxc-ls are the same as the ls command. --> - lxc-ls が受け付けるオプションは,ls コマンドと同じです. + lxc-ls が受け付けるオプションは、ls コマンドと同じです。 @@ -117,7 +117,7 @@ by KATOH Yasufumi - 全てのコンテナとそのパーミッションをリスト表示します. + 全てのコンテナとそのパーミッションをリスト表示します。 @@ -129,7 +129,7 @@ by KATOH Yasufumi - 稼働中のコンテナを一列にリスト表示します. + 稼働中のコンテナを一列にリスト表示します。 diff --git a/doc/ja/lxc-attach.sgml.in b/doc/ja/lxc-attach.sgml.in index 5b8d9f3a26..6ebc03cb50 100644 --- a/doc/ja/lxc-attach.sgml.in +++ b/doc/ja/lxc-attach.sgml.in @@ -76,8 +76,8 @@ by KATOH Yasufumi specified by name. The container has to be running already. --> - lxc-attachname で指定したコンテナ内で指定した command を実行します. - 実行する時点でコンテナが実行中でなければなりません. + lxc-attachname で指定したコンテナ内で指定した command を実行します。 + 実行する時点でコンテナが実行中でなければなりません。 - もし command が指定されていない場合,lxc-attach コマンドを実行したユーザのデフォルトシェルをコンテナ内で調べて実行します. - もしコンテナ内にユーザが存在しない場合や,コンテナで nsswitch 機構が働いていない場合はこの動作は失敗します. + もし command が指定されていない場合、lxc-attach コマンドを実行したユーザのデフォルトシェルをコンテナ内で調べて実行します。 + もしコンテナ内にユーザが存在しない場合や、コンテナで nsswitch 機構が働いていない場合はこの動作は失敗します。 @@ -117,12 +117,12 @@ by KATOH Yasufumi . By default, the current archictecture of the running container will be used. --> - コマンドを実行するコンテナのアーキテクチャを指定します. - このオプションは,コンテナの設定ファイルで指定する オプションと同じものが使用可能です. + コマンドを実行するコンテナのアーキテクチャを指定します。 + このオプションは、コンテナの設定ファイルで指定する オプションと同じものが使用可能です。 lxc.conf 5 - を参照してください.デフォルトでは,実行しているコンテナのアーキテクチャになります. + を参照してください。デフォルトでは、実行しているコンテナのアーキテクチャになります。 @@ -142,8 +142,8 @@ by KATOH Yasufumi not be added to the container's cgroup(s) and it will not drop its capabilities before executing. --> - コンテナの内部で command を実行する時に特権を削除しません. - もしこのオプションが指定された場合,新しいプロセスはコンテナの cgroup に追加 されず,実行する前にケーパビリティ (capability) も削除しません. + コンテナの内部で command を実行する時に特権を削除しません。 + もしこのオプションが指定された場合、新しいプロセスはコンテナの cgroup に追加 されず、実行する前にケーパビリティ (capability) も削除しません。 - 全ての特権の取得したくない場合は,パイプで連結したリストとして,例えば CGROUP|LSM のように,特権を指定することが可能です. - 指定できる値は,それぞれ cgroup,ケーパビリティ,特権の制限を表す CGROUPCAPLSM です. + 全ての特権の取得したくない場合は、パイプで連結したリストとして、例えば CGROUP|LSM のように、特権を指定することが可能です。 + 指定できる値は、それぞれ cgroup、ケーパビリティ、特権の制限を表す CGROUPCAPLSM です。 警告: - もし実行するコマンドが,アタッチするメインプロセスが終了した後も実行されたままのサブプロセスを開始するような場合,このオプションの指定はコンテナ内への特権のリークとなる可能性があります. - コンテナ内でのデーモンの開始(もしくは再起動)は問題となります. - デーモンが多数のサブプロセスを開始する cronsshd のような場合は特に問題となります. - 充分な注意を払って使用してください. + もし実行するコマンドが、アタッチするメインプロセスが終了した後も実行されたままのサブプロセスを開始するような場合、このオプションの指定はコンテナ内への特権のリークとなる可能性があります。 + コンテナ内でのデーモンの開始(もしくは再起動)は問題となります。 + デーモンが多数のサブプロセスを開始する cronsshd のような場合は特に問題となります。 + 充分な注意を払って使用してください。 @@ -193,18 +193,18 @@ by KATOH Yasufumi container while retaining the other namespaces as those of the host. --> - アタッチする名前空間をパイプで連結したリストで指定します. - 例えば NETWORK|IPC のようにです. - ここで使用可能な値は MOUNT, PID, UTSNAME, IPC, USER , NETWORK です. - これにより指定した名前空間にプロセスのコンテキストを変更できます. - 例えばコンテナのネットワーク名前空間に変更する一方で,他の名前空間はホストの名前空間のままにするというような事が可能です. + アタッチする名前空間をパイプで連結したリストで指定します。 + 例えば NETWORK|IPC のようにです。 + ここで使用可能な値は MOUNT, PID, UTSNAME, IPC, USER , NETWORK です。 + これにより指定した名前空間にプロセスのコンテキストを変更できます。 + 例えばコンテナのネットワーク名前空間に変更する一方で、他の名前空間はホストの名前空間のままにするというような事が可能です。 - 重要: このオプションは オプションを指定しなくても指定している場合と同様の動作をします. + 重要: このオプションは オプションを指定しなくても指定している場合と同様の動作をします。 @@ -222,22 +222,22 @@ by KATOH Yasufumi /sys to reflect the current other namespace contexts. --> - を指定し,そこにマウント名前空間が含まれない時,このオプションにより lxc-attach/proc/sys をリマウントします. - これは現在の他の名前空間のコンテキストを反映させるためです. + を指定し、そこにマウント名前空間が含まれない時、このオプションにより lxc-attach/proc/sys をリマウントします。 + これは現在の他の名前空間のコンテキストを反映させるためです。 - もっと詳細な説明は 注意 を参照してください. + もっと詳細な説明は 注意 を参照してください。 - このオプションは,マウント名前空間へのアタッチが行われる場合は無視されます. + このオプションは、マウント名前空間へのアタッチが行われる場合は無視されます。 @@ -257,11 +257,11 @@ by KATOH Yasufumi please use this option to be future-proof. In addition to current environment variables, container=lxc will be set. --> - アタッチされるプログラムに対して現在の環境を保持したままにします. - これは現在 (バージョン 0.9 時点) のデフォルトの動作ですが,将来は変更される予定です. - この動作がコンテナ内への望ましくない情報の漏洩につながる可能性があるためです. - アタッチするプログラムで環境変数が利用可能であることを期待している場合,将来的にもそれが保証されるようにこのオプションを使用するようにしてください. - 現在の環境変数に加えて,container=lxc が設定されます. + アタッチされるプログラムに対して現在の環境を保持したままにします。 + これは現在 (バージョン 0.9 時点) のデフォルトの動作ですが、将来は変更される予定です。 + この動作がコンテナ内への望ましくない情報の漏洩につながる可能性があるためです。 + アタッチするプログラムで環境変数が利用可能であることを期待している場合、将来的にもそれが保証されるようにこのオプションを使用するようにしてください。 + 現在の環境変数に加えて、container=lxc が設定されます。 @@ -278,9 +278,9 @@ by KATOH Yasufumi container=lxc will be the only environment with which the attached program starts. --> - アタッチする前に環境変数をクリアします. - これによりコンテナへの不要な環境変数の漏洩が起こらなくなります. - 変数 container=lxc のみがアタッチするプログラムの開始の時の環境変数となります. + アタッチする前に環境変数をクリアします。 + これによりコンテナへの不要な環境変数の漏洩が起こらなくなります。 + 変数 container=lxc のみがアタッチするプログラムの開始の時の環境変数となります。 @@ -300,7 +300,7 @@ by KATOH Yasufumi lxc-attach -n container --> - 存在するコンテナ内で新しいシェルを生成するには,以下のようにします. + 存在するコンテナ内で新しいシェルを生成するには、以下のようにします。 lxc-attach -n container @@ -312,7 +312,7 @@ by KATOH Yasufumi lxc-attach -n container -- /etc/init.d/cron restart --> - 実行中の Debian コンテナの cron サービスを再起動するには,以下のように実行します. + 実行中の Debian コンテナの cron サービスを再起動するには、以下のように実行します。 lxc-attach -n container -- /etc/init.d/cron restart @@ -327,7 +327,7 @@ by KATOH Yasufumi lxc-attach -n container -e -- /sbin/ip link delete eth1 --> - NET_ADMIN ケーパビリティを持たない実行中のコンテナのネットワークインターフェース eth1 の動作を停止させるには,ケーパビリティを増加させるために オプションを指定し,ip ツールがインストールされていることを前提に,以下のように実行します. + NET_ADMIN ケーパビリティを持たない実行中のコンテナのネットワークインターフェース eth1 の動作を停止させるには、ケーパビリティを増加させるために オプションを指定し、ip ツールがインストールされていることを前提に、以下のように実行します。 lxc-attach -n container -e -- /sbin/ip link delete eth1 @@ -344,9 +344,9 @@ by KATOH Yasufumi details. lxc-attach will fail in that case if used with an unpatched kernel of version 3.7 and prior. --> - (pid とマウント名前空間を含む) コンテナに対する完全なアタッチを行うには 3.8 以上,もしくはパッチを適用したカーネルが必要となります. - 詳しくは lxc のウェブサイトを参照してください. - パッチが当たっていない 3.8 より小さなバージョンのカーネルを使った場合は,lxc-attach の実行は失敗するでしょう. + (pid とマウント名前空間を含む) コンテナに対する完全なアタッチを行うには 3.8 以上、もしくはパッチを適用したカーネルが必要となります。 + 詳しくは lxc のウェブサイトを参照してください。 + パッチが当たっていない 3.8 より小さなバージョンのカーネルを使った場合は、lxc-attach の実行は失敗するでしょう。 - しかし,もし を使用して,アタッチするものを NETWORK, IPC, UTSNAME の 1 つか複数の名前空間に限定して使用すれば,バージョン 3.0 以上のパッチを適用していないカーネルでもアタッチが成功するでしょう. + しかし、もし を使用して、アタッチするものを NETWORK, IPC, UTSNAME の 1 つか複数の名前空間に限定して使用すれば、バージョン 3.0 以上のパッチを適用していないカーネルでもアタッチが成功するでしょう。 - ユーザ名前空間へのアタッチは,ユーザ名前空間機能を有効にした 3.8 以上のカーネルでサポートされます. + ユーザ名前空間へのアタッチは、ユーザ名前空間機能を有効にした 3.8 以上のカーネルでサポートされます。 @@ -382,10 +382,10 @@ by KATOH Yasufumi accessing /proc or /sys. --> - Linux の /proc/sys ファイルシステムは名前空間によって影響を受けるある程度の情報を持っています. - これは /proc 内のプロセス ID の名前のディレクトリや,/sys/class/net 内のネットワークインターフェース名のディレクトリなどです. - 擬似ファイルシステムをマウントしているプロセスの名前空間が,どのような情報を表示するかを決定します. - /proc/sys にアクセスしているプロセスの名前空間が決定するのではありません. + Linux の /proc/sys ファイルシステムは名前空間によって影響を受けるある程度の情報を持っています。 + これは /proc 内のプロセス ID の名前のディレクトリや、/sys/class/net 内のネットワークインターフェース名のディレクトリなどです。 + 擬似ファイルシステムをマウントしているプロセスの名前空間が、どのような情報を表示するかを決定します。 + /proc/sys にアクセスしているプロセスの名前空間が決定するのではありません。 - を使ってコンテナの pid 名前空間のみをアタッチし,マウント名前空間 (これはコンテナの /proc を含み,ホストのは含まないでしょう) はアタッチしない場合, のコンテンツはコンテナのものではなく,ホストのものとなります. - 似たような事例として,ネットワーク名前空間のみをアタッチして,/sys/class/net のコンテンツを読んだ場合も同じような事が起こるでしょう. + を使ってコンテナの pid 名前空間のみをアタッチし、マウント名前空間 (これはコンテナの /proc を含み、ホストのは含まないでしょう) はアタッチしない場合、 のコンテンツはコンテナのものではなく、ホストのものとなります。 + 似たような事例として、ネットワーク名前空間のみをアタッチして、/sys/class/net のコンテンツを読んだ場合も同じような事が起こるでしょう。 - この問題への対処のために, オプションが /proc/sys が提供されています. - これにより,アタッチするプロセスのネットワーク/pid 名前空間のコンテキストを反映させることができます.ホストの実際のファイルシステムに影響を与えないために,実行前にはマウント名前空間は unshare されます (lxc-unshare のように). - これは,/proc/sys ファイルシステム以外はホストのマウント名前空間と同じである,新しいマウント名前空間がプロセスに与えられるということです. + この問題への対処のために、 オプションが /proc/sys が提供されています。 + これにより、アタッチするプロセスのネットワーク/pid 名前空間のコンテキストを反映させることができます。ホストの実際のファイルシステムに影響を与えないために、実行前にはマウント名前空間は unshare されます (lxc-unshare のように)。 + これは、/proc/sys ファイルシステム以外はホストのマウント名前空間と同じである、新しいマウント名前空間がプロセスに与えられるということです。 @@ -428,8 +428,8 @@ by KATOH Yasufumi be used with care, as it may break the isolation of the containers if used improperly. --> - オプションの使用には注意を払うべきです. - 不適切に使用した場合,コンテナの隔離を破壊してしまう可能性があります. + オプションの使用には注意を払うべきです。 + 不適切に使用した場合、コンテナの隔離を破壊してしまう可能性があります。 diff --git a/doc/ja/lxc-autostart.sgml.in b/doc/ja/lxc-autostart.sgml.in index 513c54080c..090b05a5d3 100644 --- a/doc/ja/lxc-autostart.sgml.in +++ b/doc/ja/lxc-autostart.sgml.in @@ -76,10 +76,10 @@ by KATOH Yasufumi and the list of affected containers (and if relevant, delays) will be shown. --> - lxc-autostart は lxc.start.auto が設定されたコンテナの処理を行います. - ユーザがコンテナの開始,シャットダウン,kill,再起動を,設定した時間間隔で,設定した順番で行えるようにします. - lxc.group でのフィルタリングによって,もしくは定義された全てのコンテナを実行します. - 何の動作も行わず,対象のコンテナ (とコンテナに設定された起動待機時間) のリストを表示するリストモードを外部ツールから使用することも可能です. + lxc-autostart は lxc.start.auto が設定されたコンテナの処理を行います。 + ユーザがコンテナの開始、シャットダウン、kill、再起動を、設定した時間間隔で、設定した順番で行えるようにします。 + lxc.group でのフィルタリングによって、もしくは定義された全てのコンテナを実行します。 + 何の動作も行わず、対象のコンテナ (とコンテナに設定された起動待機時間) のリストを表示するリストモードを外部ツールから使用することも可能です。 @@ -94,9 +94,9 @@ by KATOH Yasufumi of time to wait for the container to complete the shutdown or reboot. --> - -r, -s, -k オプションは実行する動作を指定します.何も指定しない場合は,コンテナを起動します. - -a, -g は,どのコンテナを対象にするかを指定するのに使います.デフォルトでは,lxc.group が指定されていないコンテナにだけが対象となります. - -t TIMEOUT はコンテナが完全にシャットダウンもしくはリブートを待つ最大時間を指定します. + -r, -s, -k オプションは実行する動作を指定します。何も指定しない場合は、コンテナを起動します。 + -a, -g は、どのコンテナを対象にするかを指定するのに使います。デフォルトでは、lxc.group が指定されていないコンテナにだけが対象となります。 + -t TIMEOUT はコンテナが完全にシャットダウンもしくはリブートを待つ最大時間を指定します。 @@ -112,7 +112,7 @@ by KATOH Yasufumi - コンテナのリブートを要求します. + コンテナのリブートを要求します。 @@ -130,7 +130,7 @@ by KATOH Yasufumi this period, it will be killed as with the -k kill option. --> - クリーンなシャットダウンを要求します.もし,-t timeout が 0 より大きい場合で,コンテナがこの時間内にシャットダウンしない場合は,コンテナは -k kill オプションを指定した時のように kill されます. + クリーンなシャットダウンを要求します。もし、-t timeout が 0 より大きい場合で、コンテナがこの時間内にシャットダウンしない場合は、コンテナは -k kill オプションを指定した時のように kill されます。 @@ -145,7 +145,7 @@ by KATOH Yasufumi Rather than requesting a clean shutdown of the container, explicitly kill all tasks in the container. --> - コンテナのクリーンなシャットダウンを要求するのではなく,明確にコンテナの全てのタスクを kill します. + コンテナのクリーンなシャットダウンを要求するのではなく、明確にコンテナの全てのタスクを kill します。 @@ -160,7 +160,7 @@ by KATOH Yasufumi Rather than performing the action, just print the container name. --> - 実際の動作は行わず,コンテナ名の表示だけを行います. + 実際の動作は行わず、コンテナ名の表示だけを行います。 @@ -174,7 +174,7 @@ by KATOH Yasufumi - コンテナの強制停止まで TIMEOUT 秒待ちます. + コンテナの強制停止まで TIMEOUT 秒待ちます。 @@ -186,10 +186,21 @@ by KATOH Yasufumi - 対象にするコンテナのグループのカンマ区切りのリスト (デフォルトでは lxc.group 指定のないコンテナが対象になります). + 対象にするコンテナのグループのカンマ区切りのリスト (デフォルトでは lxc.group 指定のないコンテナ、つまり NULL グループが対象になります)。 + このオプションは複数回指定することができ、オプションは連結されます。NULL もしくは空のグループは、NULL グループを処理すべき場所に指定された先頭のカンマ、末尾のカンマ、途中に現れる 2 つ続きのカンマ、空のオプション引数で指定することができます。 + グループはコマンドラインで指定された順番に処理されます。-g オプションの複数回の呼び出しはカンマ区切りのリストと自由に混ぜることができ、指定した順番に連結されます。 @@ -203,7 +214,94 @@ by KATOH Yasufumi - lxc.group の指定を無視して,自動起動が設定されているコンテナを全て選択します. + lxc.group の指定を無視して、自動起動が設定されているコンテナを全て選択します。 + + + + + + + + <!-- Autostart and System Boot -->自動起動とシステムブート + + + + lxc-autostart コマンドは、LXC システムサービスがホストシステムのブートおよびシャットダウン時に実行するように有効化されているとき、LXC システムサービスの一部として使用されます。 + このコマンドはホストシステムのブート時に、どのコンテナをどういう順番で、それぞれのコンテナの起動間隔をどれくらい開けるかを選択するのに使います。 + + + + + コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。 + + + + + LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。 + lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。 + "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。 + + + + + <!-- Startup Group Examples -->スタートアップグループの例 + + + + + + + + + まず最初に "onboot" グループの処理を開始し、その後 NULL グループの処理を開始します。 + + + + これは以下と等価です: + + + + + + + + + + + まず最初に "dns" グループの処理を開始し、2 番目に "web" グループ、その後 NULL グループ、"onboot" グループの順に処理を開始します。 + + + + これは以下と等価です: もしくは diff --git a/doc/ja/lxc-cgroup.sgml.in b/doc/ja/lxc-cgroup.sgml.in index 6e771df39d..10f3a0d82d 100644 --- a/doc/ja/lxc-cgroup.sgml.in +++ b/doc/ja/lxc-cgroup.sgml.in @@ -73,8 +73,8 @@ by KATOH Yasufumi current value of the state-object is displayed; otherwise it is set. --> - lxc-cgroup は,コンテナの cgroup の一致するサブシステム (例えば 'cpuset') の state-object (例えば 'cpuset.cpus') の値を取得したり,値を設定したりします. - value が指定されないときは,state-object の値を表示します.指定されている場合は値を設定します. + lxc-cgroup は、コンテナの cgroup の一致するサブシステム (例えば 'cpuset') の state-object (例えば 'cpuset.cpus') の値を取得したり、値を設定したりします。 + value が指定されないときは、state-object の値を表示します。指定されている場合は値を設定します。 @@ -84,8 +84,8 @@ by KATOH Yasufumi kernel, or that the corresponding subsystem is contained in any mounted cgroup hierarchy. --> - lxc-cgroupstate-object が実行中のカーネルで有効かどうかのチェックを行いません. - また,指定したサブシステムがマウントされた cgroup の階層構造に含まれているかどうかのチェックを行いません. + lxc-cgroupstate-object が実行中のカーネルで有効かどうかのチェックを行いません。 + また、指定したサブシステムがマウントされた cgroup の階層構造に含まれているかどうかのチェックを行いません。 @@ -103,7 +103,7 @@ by KATOH Yasufumi - (cgroup の) 状態オブジェクト (state object) 名を指定します. + (cgroup の) 状態オブジェクト (state object) 名を指定します。 @@ -117,7 +117,7 @@ by KATOH Yasufumi - (cgroup の) 状態オブジェクト (state object) に設定する値を指定します. + (cgroup の) 状態オブジェクト (state object) に設定する値を指定します。 @@ -138,7 +138,7 @@ by KATOH Yasufumi - 使用が許可されているデバイスを表示します. + 使用が許可されているデバイスを表示します。 @@ -150,7 +150,7 @@ by KATOH Yasufumi - コンテナにプロセッサ番号 0 と 3 のプロセッサを割り当てます. + コンテナにプロセッサ番号 0 と 3 のプロセッサを割り当てます。 @@ -170,7 +170,7 @@ by KATOH Yasufumi - コンテナが実行されていません. + コンテナが実行されていません。 diff --git a/doc/ja/lxc-checkconfig.sgml.in b/doc/ja/lxc-checkconfig.sgml.in index 196b7e3386..9912d807b5 100644 --- a/doc/ja/lxc-checkconfig.sgml.in +++ b/doc/ja/lxc-checkconfig.sgml.in @@ -62,7 +62,7 @@ by KATOH Yasufumi lxc-checkconfig check the current kernel for lxc support --> - lxc-checkconfig は,現在のカーネルが lxc に必要な機能をサポートしているかをチェックします. + lxc-checkconfig は、現在のカーネルが lxc に必要な機能をサポートしているかをチェックします。 @@ -77,9 +77,9 @@ by KATOH Yasufumi check the current kernel. CONFIG can be set in the environment to an alternate location. --> - 現在のカーネルをチェックします. - CONFIG 環境変数に別の場所を設定することも可能です. - (訳注: カーネルビルド時の設定オプションのファイルの位置を指定します.デフォルトは /proc/config.gz です.) + 現在のカーネルをチェックします。 + CONFIG 環境変数に別の場所を設定することも可能です。 + (訳注: カーネルビルド時の設定オプションのファイルの位置を指定します。デフォルトは /proc/config.gz です。) diff --git a/doc/ja/lxc-clone.sgml.in b/doc/ja/lxc-clone.sgml.in index 1cdc259428..0a7448ba9a 100644 --- a/doc/ja/lxc-clone.sgml.in +++ b/doc/ja/lxc-clone.sgml.in @@ -98,13 +98,13 @@ by KATOH Yasufumi this includes only aufs, btrfs, lvm, overlayfs and zfs. LVM devices do not support snapshots of snapshots. --> - lxc-clone は,新しいコンテナを既に存在するコンテナのクローンとして作製します. - クローンは 2 つのタイプをサポートします: コピーとスナップショットです. - コピータイプのクローンは元のコンテナから新しいコンテナへ root ファイルシステムをコピーします. - スナップショットファイルシステムは,バッキングストアのスナップショット機能を使い,元のコンテナの非常に小さな copy-on-write でのスナップショットを作製します. - スナップショットでのクローンは,新しいコンテナのバッキングストアとしてスナップショット機能のサポートが必要になります. - 現時点では,このようなバッキングストアとしては aufs, btrfs, lvm, overlayfs, zfs のみをサポートします. - LVM デバイスはスナップショットのスナップショットはサポートしていません. + lxc-clone は、新しいコンテナを既に存在するコンテナのクローンとして作製します。 + クローンは 2 つのタイプをサポートします: コピーとスナップショットです。 + コピータイプのクローンは元のコンテナから新しいコンテナへ root ファイルシステムをコピーします。 + スナップショットファイルシステムは、バッキングストアのスナップショット機能を使い、元のコンテナの非常に小さな copy-on-write でのスナップショットを作製します。 + スナップショットでのクローンは、新しいコンテナのバッキングストアとしてスナップショット機能のサポートが必要になります。 + 現時点では、このようなバッキングストアとしては aufs, btrfs, lvm, overlayfs, zfs のみをサポートします。 + LVM デバイスはスナップショットのスナップショットはサポートしていません。 @@ -115,9 +115,9 @@ by KATOH Yasufumi containers. This can be requested by using (for overlayfs) the -B overlayfs arguments. --> - 新しいコンテナのバッキングストアは,オーバーレイタイプのコンテナを除いては元のコンテナのタイプと同じになります. - ディレクトリバックエンドのコンテナのスナップショットを aufs もしくは overlayfs で作成することは可能です. - 例えば,overlayfs の場合は -B overlayfs という引数を使って指定することが可能です. + 新しいコンテナのバッキングストアは、オーバーレイタイプのコンテナを除いては元のコンテナのタイプと同じになります。 + ディレクトリバックエンドのコンテナのスナップショットを aufs もしくは overlayfs で作成することは可能です。 + 例えば、overlayfs の場合は -B overlayfs という引数を使って指定することが可能です。 @@ -127,7 +127,7 @@ by KATOH Yasufumi -o and -n options, respectively. --> - 元のコンテナと新しいコンテナの名前は,全てのオプションの後に順番に与えることも,-o-n オプションを使ってそれぞれ指定することも可能です. + 元のコンテナと新しいコンテナの名前は、全てのオプションの後に順番に与えることも、-o-n オプションを使ってそれぞれ指定することも可能です。 @@ -147,7 +147,7 @@ by KATOH Yasufumi - 新しいコンテナの rootfs は,オリジナルの LVM か btrfs のスナップショットになります. + 新しいコンテナの rootfs は、オリジナルの LVM か btrfs のスナップショットになります。 @@ -162,7 +162,7 @@ by KATOH Yasufumi Do not change the hostname of the container (in the root filesystem). --> - (root ファイルシステム内では) コンテナのホスト名を変更しません. + (root ファイルシステム内では) コンテナのホスト名を変更しません。 @@ -177,7 +177,7 @@ by KATOH Yasufumi Use the same MAC address as the original container, rather than generating a new random one. --> - 新しい MAC アドレスをランダムに生成せずに,元のコンテナと同じ MAC アドレスを使用します. + 新しい MAC アドレスをランダムに生成せずに、元のコンテナと同じ MAC アドレスを使用します。 @@ -192,8 +192,8 @@ by KATOH Yasufumi Copy all mount hooks into the new container's directory, and update any lxcpaths and container names as needed. --> - 全てのマウントフックを新しいコンテナのディレクトリにコピーします. - そして,lxcpath とコンテナ名を必要に応じて更新します. + 全てのマウントフックを新しいコンテナのディレクトリにコピーします。 + そして、lxcpath とコンテナ名を必要に応じて更新します。 @@ -209,15 +209,15 @@ by KATOH Yasufumi block device. By default, the new device will be made the same size as the original. --> - ブロックデバイスのバックエンドのコンテナの場合,新しいブロックデバイスのサイズ. - デフォルトでは,新しいデバイスは元のデバイスと同じサイズとなります. + ブロックデバイスのバックエンドのコンテナの場合、新しいブロックデバイスのサイズ。 + デフォルトでは、新しいデバイスは元のデバイスと同じサイズとなります。 - + @@ -225,14 +225,14 @@ by KATOH Yasufumi The lxcpath of the original container. By default, the system wide configured lxcpath will be used. --> - オリジナルのコンテナの lxcpath.デフォルトでは,システム全体で設定された lxcpath が使われます. + オリジナルのコンテナの lxcpath。デフォルトでは、システム全体で設定された lxcpath が使われます。 - + @@ -242,17 +242,17 @@ by KATOH Yasufumi changing lxcpaths may not be possible, as subvolume snapshots must be in the same btrfs filesystem. --> - 新しいコンテナの lxcpath. - デフォルトでは,オリジナルの lxcpath と同じものが使われます. - btrfs のスナップショットの場合は注意が必要で,lxcpath の変更はできない可能性があります. - これは subvolume のスナップショットが,同じ btrfs ファイルシステム上に存在しなければならないからです. + 新しいコンテナの lxcpath。 + デフォルトでは、オリジナルの lxcpath と同じものが使われます。 + btrfs のスナップショットの場合は注意が必要で、lxcpath の変更はできない可能性があります。 + これは subvolume のスナップショットが、同じ btrfs ファイルシステム上に存在しなければならないからです。 - + @@ -264,10 +264,10 @@ by KATOH Yasufumi backing stores include dir (directory), aufs, btrfs, lvm, zfs, loop and overlayfs. --> - 新しいコンテナで元のコンテナと違うバッキングストアを使う場合のバッキングストアを選択します. - デフォルトでは元のコンテナと同じものが使われます. - 現時点では,バッキングストアの変更は,ディレクトリバックエンドのコンテナに対する aufs と overlayfs のスナップショットに対してのみサポートされます. - 有効なバッキングストアは dir(directory), aufs, btrfs, lvm, zfs, loop, overlayfs です. + 新しいコンテナで元のコンテナと違うバッキングストアを使う場合のバッキングストアを選択します。 + デフォルトでは元のコンテナと同じものが使われます。 + 現時点では、バッキングストアの変更は、ディレクトリバックエンドのコンテナに対する aufs と overlayfs のスナップショットに対してのみサポートされます。 + 有効なバッキングストアは dir(directory), aufs, btrfs, lvm, zfs, loop, overlayfs です。 @@ -281,7 +281,7 @@ by KATOH Yasufumi - クローンしたい元のコンテナの名前. + クローンしたい元のコンテナの名前。 @@ -295,7 +295,7 @@ by KATOH Yasufumi - 作製する新しいコンテナの名前. + 作製する新しいコンテナの名前。 @@ -321,11 +321,11 @@ by KATOH Yasufumi LXC_SRC_NAME, and the path or device on which the rootfs is located is in LXC_ROOTFS_PATH. --> - クローンされるコンテナに 1 つ以上の lxc.hook.clone の指定が存在する場合,指定されたフックは新しいコンテナに対して呼ばれます. - クローンフックに渡される最初の 3 つの引数は,コンテナ名,セクション ('lxc'),フックタイプ ('clone') となります. - lxc-clone に渡される追加の引数は,フックプログラムに渡される引数の 4 番目以降となります. - LXC_ROOTFS_MOUNT 環境変数には,コンテナの root ファイルシステムがマウントされるパスが与えられます. - 設定ファイルのパス名は LXC_CONFIG_FILE に,新しいコンテナ名は LXC_NAME,古いコンテナ名は LXC_SRC_NAME に,rootfs のあるパスまたはデバイスは LXC_ROOTFS_PATH に保存されます. + クローンされるコンテナに 1 つ以上の lxc.hook.clone の指定が存在する場合、指定されたフックは新しいコンテナに対して呼ばれます。 + クローンフックに渡される最初の 3 つの引数は、コンテナ名、セクション ('lxc')、フックタイプ ('clone') となります。 + lxc-clone に渡される追加の引数は、フックプログラムに渡される引数の 4 番目以降となります。 + LXC_ROOTFS_MOUNT 環境変数には、コンテナの root ファイルシステムがマウントされるパスが与えられます。 + 設定ファイルのパス名は LXC_CONFIG_FILE に、新しいコンテナ名は LXC_NAME、古いコンテナ名は LXC_SRC_NAME に、rootfs のあるパスまたはデバイスは LXC_ROOTFS_PATH に保存されます。 diff --git a/doc/ja/lxc-config.sgml.in b/doc/ja/lxc-config.sgml.in index 95526d7c5b..9e1d1b61f2 100644 --- a/doc/ja/lxc-config.sgml.in +++ b/doc/ja/lxc-config.sgml.in @@ -66,7 +66,7 @@ by KATOH Yasufumi configuration and lets you list all valid keys or query individual keys for their value. --> - lxc-config は LXC のシステム設定の有効な設定項目名を一覧表示したり,個々の設定項目に設定されている値を表示したりします. + lxc-config は LXC のシステム設定の有効な設定項目名を一覧表示したり、個々の設定項目に設定されている値を表示したりします。 @@ -82,7 +82,7 @@ by KATOH Yasufumi - サポートされている全ての設定項目を表示します. + サポートされている全ての設定項目を表示します。 @@ -96,7 +96,7 @@ by KATOH Yasufumi - 指定した設定項目に設定されている値を表示します. + 指定した設定項目に設定されている値を表示します。 diff --git a/doc/ja/lxc-console.sgml.in b/doc/ja/lxc-console.sgml.in index db4d6eda65..3ab395c699 100644 --- a/doc/ja/lxc-console.sgml.in +++ b/doc/ja/lxc-console.sgml.in @@ -70,7 +70,7 @@ by KATOH Yasufumi container specified as parameter, this command will launch a console allowing to log on the container. --> - パラメータで指定したコンテナで tty サービスが設定され,利用可能である場合,このコマンドはコンテナにログイン出来るコンソールを起動します. + パラメータで指定したコンテナで tty サービスが設定され、利用可能である場合、このコマンドはコンテナにログイン出来るコンソールを起動します。 @@ -80,8 +80,8 @@ by KATOH Yasufumi has been launched four times each taking a different tty, the fifth command will fail because no console will be available. --> - 利用可能な tty は,このコマンドが取得した空いている tty です. - これは,コンテナに 4 つの利用可能な tty がある場合,コマンドは 4 個までそれぞれ異なる tty を取得して開きます.5 回目のコマンドは利用可能なコンソールがないため,失敗します. + 利用可能な tty は、このコマンドが取得した空いている tty です。 + これは、コンテナに 4 つの利用可能な tty がある場合、コマンドは 4 個までそれぞれ異なる tty を取得して開きます。5 回目のコマンドは利用可能なコンソールがないため、失敗します。 @@ -90,8 +90,8 @@ by KATOH Yasufumi broken, the command can be launched again and regain the tty at the state it was before the disconnection. --> - コマンドは tty に接続します. - もし,接続が失われたり,切断された場合,コマンドは再度起動し,切断前の状態で tty の再取得をしようとします. + コマンドは tty に接続します。 + もし、接続が失われたり、切断された場合、コマンドは再度起動し、切断前の状態で tty の再取得をしようとします。 @@ -100,7 +100,7 @@ by KATOH Yasufumi to the container's /dev/console instead of its dev/tty<ttynum>. --> - ttynum を 0 に設定すると,dev/tty<ttynum>の代わりにコンテナの /dev/console に接続します. + ttynum を 0 に設定すると、dev/tty<ttynum>の代わりにコンテナの /dev/console に接続します。 @@ -108,8 +108,8 @@ by KATOH Yasufumi A keyboard escape sequence may be used to disconnect from the tty and quit lxc-console. The default escape sequence is <Ctrl+a q>. --> - tty からの接続を切断し,lxc-console を抜ける時に,キーボードのエスケープシーケンスを使います. - デフォルトのエスケープシーケンスは <Ctrl+a q> です. + tty からの接続を切断し、lxc-console を抜ける時に、キーボードのエスケープシーケンスを使います。 + デフォルトのエスケープシーケンスは <Ctrl+a q> です。 @@ -130,9 +130,9 @@ by KATOH Yasufumi This may be given as '^letter' or just 'letter'. For example to use <Ctrl+b q> as the escape sequence use -e '^b'. --> - <Ctrl a> の代わりに使用するエスケープシーケンスのプレフィックスを指定します. - これは '^文字' または単なる '文字' で指定します. - 例えば,<Ctrl+b q> をエスケープシーケンスとして使うには -e '^b' とします. + <Ctrl a> の代わりに使用するエスケープシーケンスのプレフィックスを指定します。 + これは '^文字' または単なる '文字' で指定します。 + 例えば、<Ctrl+b q> をエスケープシーケンスとして使うには -e '^b' とします。 @@ -147,8 +147,8 @@ by KATOH Yasufumi specified the next available tty number will be automatically chosen by the container. --> - 接続する tty の番号か,コンソールに接続するために 0 を指定します. - 指定しない場合は,次に利用可能な tty 番号を自動的にコンテナが選択します. + 接続する tty の番号か、コンソールに接続するために 0 を指定します。 + 指定しない場合は、次に利用可能な tty 番号を自動的にコンテナが選択します。 @@ -173,8 +173,8 @@ by KATOH Yasufumi use the console. For example, the container belongs to user "foo" and "bar" is trying to open a console to it. --> - 利用可能な tty がないか,コンソールを使うのに十分な権限がありません. - 例えば,コンテナが "foo" ユーザの所有であるのに,"bar" ユーザがコンソールを開こうとしている場合などです. + 利用可能な tty がないか、コンソールを使うのに十分な権限がありません。 + 例えば、コンテナが "foo" ユーザの所有であるのに、"bar" ユーザがコンソールを開こうとしている場合などです。 diff --git a/doc/ja/lxc-create.sgml.in b/doc/ja/lxc-create.sgml.in index 299dc24767..78d2f94575 100644 --- a/doc/ja/lxc-create.sgml.in +++ b/doc/ja/lxc-create.sgml.in @@ -74,15 +74,15 @@ by KATOH Yasufumi is used to specify the container to be used with the different lxc commands. --> - lxc-create は,設定情報とユーザ情報が保存されているシステムオブジェクトを作成します. - name で指定された名前が,他の lxc コマンドで,コンテナを特定する名前として使われます. + lxc-create は、設定情報とユーザ情報が保存されているシステムオブジェクトを作成します。 + name で指定された名前が、他の lxc コマンドで、コンテナを特定する名前として使われます。 - オブジェクトは @LXCPATH@ 内に作られる,自身の名前がついたディレクトリです. + オブジェクトは @LXCPATH@ 内に作られる、自身の名前がついたディレクトリです。 @@ -92,8 +92,8 @@ by KATOH Yasufumi contains information, the more the container is isolated and the more the application is jailed. --> - オブジェクトは,アプリケーションが使用したり,参照したりする様々なリソースの定義です. - 設定ファイルがより多くの情報を持つほど,コンテナやアプリケーションはより隔離されたものになります. + オブジェクトは、アプリケーションが使用したり、参照したりする様々なリソースの定義です。 + 設定ファイルがより多くの情報を持つほど、コンテナやアプリケーションはより隔離されたものになります。 @@ -102,7 +102,7 @@ by KATOH Yasufumi is not specified, the container will be created with the default isolation: processes, sysv ipc and mount points. --> - 設定ファイルが config_file で指定されない場合,コンテナはデフォルトの隔離状態で作られます: プロセス,sysv ipc,マウントポイントです. + 設定ファイルが config_file で指定されない場合、コンテナはデフォルトの隔離状態で作られます: プロセス、sysv ipc、マウントポイントです。 @@ -120,7 +120,7 @@ by KATOH Yasufumi Specify the configuration file to configure the virtualization and isolation functionalities for the container. --> - コンテナの仮想化と隔離機能を設定するための設定ファイルを指定します. + コンテナの仮想化と隔離機能を設定するための設定ファイルを指定します。 @@ -140,10 +140,10 @@ by KATOH Yasufumi Alternatively, the full path to an executable template script can also be passed as a parameter. --> - template は lxc-create コマンドが呼び出す,存在する 'lxc-template' スクリプトの短い名前です. - 例えば,busybox, debian, fedora, ubuntu, sshd があります. - 期待されるスクリプトの構造の詳細は,@LXCTEMPLATEDIR@ 内の例を参照してください. - 加えて,実行可能なテンプレートスクリプトへのフルパスも指定することが可能です. + template は lxc-create コマンドが呼び出す、存在する 'lxc-template' スクリプトの短い名前です。 + 例えば、busybox, debian, fedora, ubuntu, sshd があります。 + 期待されるスクリプトの構造の詳細は、@LXCTEMPLATEDIR@ 内の例を参照してください。 + 加えて、実行可能なテンプレートスクリプトへのフルパスも指定することが可能です。 @@ -155,13 +155,14 @@ by KATOH Yasufumi - 'backingstore' には 'none' か 'dir' か 'lvm' か 'btrfs' か 'best' のいずれかを指定します. - デフォルトは 'none' で,コンテナのルートファイルシステムが @LXCPATH@/container/rootfs 以下のディレクトリであることを意味します. -'dir' は 'none' と同じ意味ですが,オプションとして --dir ROOTFS を指定することも可能です. - このオプションは,デフォルトの代わりに特定のパス以下にコンテナの rootfs を置くということになります. - 'btrfs' が指定された場合,ターゲットのファイルシステムは btrfs でなければいけません. - そして,コンテナの rootfs は新しい subvolume として作製されます. - このことにより,スナップショットによるクローンが作製可能になりますが,結果として rsync --one-filesystem が,別々のファイルシステムとして取り扱ってしまうことにもなります. - backingstore が 'lvm' である場合,lvm ブロックデバイスを使用します. - この時,以下のオプションが有効になります: --lvname lvname1 はデフォルト値のコンテナ名の LV の代わりに lvname1 という名前の LV を作成します. - --vgname vgname1 は,デフォルト値である lxc という volume group の代わりに vgname1 という名前の volume group 内に LV を作成します. - --thinpool thinpool1 は,デフォルトである lxc のという名前のプールの代わりに thinpool1 という名前のプール内にシンプロビジョニングされたボリュームとして LV を作成します. - --fstype FSTYPE は LV 上のファイルシステムをデフォルト値である ext4 の代わりに FSTYPE で指定したもので作成します. - --fssize SIZE はデフォルト値である 1G の代わりに SIZE で指定したサイズで LV を作成します. + 'backingstore' には 'dir' か 'lvm' か 'loop' か 'btrfs' か 'best' のいずれかを指定します。 + デフォルトは 'dir' で、コンテナのルートファイルシステムが @LXCPATH@/container/rootfs 以下のディレクトリであることを意味します。 + 'dir' にはオプションとして --dir ROOTFS を指定することも可能です。 + このオプションは、デフォルトの代わりに特定のパス以下にコンテナの rootfs を置くということになります。 + ('none' は 'dir' のエイリアスです。) + 'btrfs' が指定された場合、ターゲットのファイルシステムは btrfs でなければいけません。 + そして、コンテナの rootfs は新しい subvolume として作製されます。 + このことにより、スナップショットによるクローンが作製可能になりますが、結果として rsync --one-filesystem が、別々のファイルシステムとして取り扱ってしまうことにもなります。 + backingstore が 'lvm' である場合、lvm ブロックデバイスを使用します。 + この時、以下のオプションが有効になります: --lvname lvname1 はデフォルト値のコンテナ名の LV の代わりに lvname1 という名前の LV を作成します。 + --vgname vgname1 は、デフォルト値である lxc という volume group の代わりに vgname1 という名前の volume group 内に LV を作成します。 + --thinpool thinpool1 は、デフォルトである lxc のという名前のプールの代わりに thinpool1 という名前のプール内にシンプロビジョニングされたボリュームとして LV を作成します。 + --fstype FSTYPE は LV 上のファイルシステムをデフォルト値である ext4 の代わりに FSTYPE で指定したもので作成します。 + --fssize SIZE はデフォルト値である 1G の代わりに SIZE で指定したサイズで LV を作成します。 - backingstore が 'best' の時,lxc は btrfs, zfs, lvm, dir の順に試行します. + backingstore が 'best' の時、lxc は btrfs, zfs, lvm, dir の順に試行します。 @@ -218,8 +220,8 @@ by KATOH Yasufumi the template, you can run lxc-create -t TEMPLATE -h. --> - これは template-options で指定したものをオプションとしてテンプレートへ渡します. - テンプレートでサポートされているオプションを調べるには,lxc-create -t TEMPLATE -h というコマンドが使えます. + これは template-options で指定したものをオプションとしてテンプレートへ渡します。 + テンプレートでサポートされているオプションを調べるには、lxc-create -t TEMPLATE -h というコマンドが使えます。 @@ -245,8 +247,8 @@ by KATOH Yasufumi the lxc-ls command to list the available containers on the system. --> - メッセージの通り,コンテナを作成しようとしたけれども,同じ名前のコンテナが存在しています. - lxc-ls コマンドを使って,システム上に存在する利用可能なコンテナのリストが表示できます. + メッセージの通り、コンテナを作成しようとしたけれども、同じ名前のコンテナが存在しています。 + lxc-ls コマンドを使って、システム上に存在する利用可能なコンテナのリストが表示できます。 diff --git a/doc/ja/lxc-destroy.sgml.in b/doc/ja/lxc-destroy.sgml.in index c10d8b9657..05519c29cb 100644 --- a/doc/ja/lxc-destroy.sgml.in +++ b/doc/ja/lxc-destroy.sgml.in @@ -68,7 +68,7 @@ by KATOH Yasufumi lxc-destroy destroys the system object previously created by the lxc-create command. --> - lxc-destroy は,lxc-create で以前に作成したシステムオブジェクトを破壊します. + lxc-destroy は、lxc-create で以前に作成したシステムオブジェクトを破壊します。 @@ -89,8 +89,8 @@ by KATOH Yasufumi not specified and the container is running, then lxc-destroy will be aborted. --> - コンテナが実行中の場合,まずコンテナを停止させます. - このオプションが指定されていない場合でコンテナが実行中の場合,lxc-destroy コマンドは実行を中断します. + コンテナが実行中の場合、まずコンテナを停止させます。 + このオプションが指定されていない場合でコンテナが実行中の場合、lxc-destroy コマンドは実行を中断します。 @@ -102,7 +102,7 @@ by KATOH Yasufumi - コンテナパスを指定します.デフォルトは @LXCPATH@ です. + コンテナパスを指定します。デフォルトは @LXCPATH@ です。 @@ -126,9 +126,9 @@ by KATOH Yasufumi destroyed.You can use the lxc-ls command to list the available containers on the system. --> - 破壊するために指定したコンテナが見つかりません. - おそらくそのコンテナが存在しないのか,既に破壊された後なのでしょう. - lxc-ls コマンドを使って,システム上に存在するコンテナのリストを得ることができます. + 破壊するために指定したコンテナが見つかりません。 + おそらくそのコンテナが存在しないのか、既に破壊された後なのでしょう。 + lxc-ls コマンドを使って、システム上に存在するコンテナのリストを得ることができます。 diff --git a/doc/ja/lxc-device.sgml.in b/doc/ja/lxc-device.sgml.in index d9c25da5d5..b7ce11585e 100644 --- a/doc/ja/lxc-device.sgml.in +++ b/doc/ja/lxc-device.sgml.in @@ -67,7 +67,7 @@ by KATOH Yasufumi - lxc-device は実行中のコンテナのデバイスを管理します. + lxc-device は実行中のコンテナのデバイスを管理します。 @@ -83,7 +83,7 @@ by KATOH Yasufumi - コマンドのヘルプを表示します. + コマンドのヘルプを表示します。 @@ -111,7 +111,7 @@ by KATOH Yasufumi - 実行するアクション.現時点では 'add' のみ指定できます. + 実行するアクション。現時点では 'add' のみ指定できます。 @@ -127,8 +127,8 @@ by KATOH Yasufumi It can either be the path to a device under /dev or a network interface name. --> - コンテナに追加するデバイス. - /dev 以下のデバイスのパスかネットワークインターフェース名を指定できます. + コンテナに追加するデバイス。 + /dev 以下のデバイスのパスかネットワークインターフェース名を指定できます。 @@ -160,7 +160,7 @@ by KATOH Yasufumi Creates a /dev/video0 device in container p1 based on the matching device on the host. --> - コンテナ p1 内に,ホスト上でマッチするデバイスに基づいて /dev/video0 デバイスを作製します. + コンテナ p1 内に、ホスト上でマッチするデバイスに基づいて /dev/video0 デバイスを作製します。 @@ -172,7 +172,7 @@ by KATOH Yasufumi - eth0 をホストから p1 内の eth1 に移動します. + eth0 をホストから p1 内の eth1 に移動します。 diff --git a/doc/ja/lxc-execute.sgml.in b/doc/ja/lxc-execute.sgml.in index db73b7ecf2..93a96d7a4d 100644 --- a/doc/ja/lxc-execute.sgml.in +++ b/doc/ja/lxc-execute.sgml.in @@ -71,7 +71,7 @@ by KATOH Yasufumi command inside the container specified by name. --> - lxc-execute は指定した command を,name で指定したコンテナ内で実行します. + lxc-execute は指定した command を、name で指定したコンテナ内で実行します。 - このコマンドは,lxc-create コマンドであらかじめ定義した設定,もしくはパラメータとして与えた設定ファイルを元にコンテナをセットアップします. - もし設定が定義されていない場合,デフォルトの隔離を使用します. + このコマンドは、lxc-create コマンドであらかじめ定義した設定、もしくはパラメータとして与えた設定ファイルを元にコンテナをセットアップします。 + もし設定が定義されていない場合、デフォルトの隔離を使用します。 - このコマンドは主に,素早く単一のアプリケーションを隔離された環境で動作させたい時に使います. + このコマンドは主に、素早く単一のアプリケーションを隔離された環境で動作させたい時に使います。 - lxc-execute は,lxc-init を間にはさんで,コンテナ内で特定のコマンドを実行します. - lxc-init は,指定されたコマンドが実行された後は,そのコマンドの終了と,そのコマンドから生成された全てのプロセスの終了を待ちます (これにより,コンテナ内でデーモンのサポートが可能になります). - 言いかえると,コンテナ内では lxc-init が pid 1 となり,アプリケーションの最初のプロセスの pid が 2 となります. + lxc-execute は、lxc-init を間にはさんで、コンテナ内で特定のコマンドを実行します。 + lxc-init は、指定されたコマンドが実行された後は、そのコマンドの終了と、そのコマンドから生成された全てのプロセスの終了を待ちます (これにより、コンテナ内でデーモンのサポートが可能になります)。 + 言いかえると、コンテナ内では lxc-init が pid 1 となり、アプリケーションの最初のプロセスの pid が 2 となります。 - 前述の lxc-init は,受け取ったシグナルを開始したコマンドに送るように設計されています. + 前述の lxc-init は、受け取ったシグナルを開始したコマンドに送るように設計されています。 @@ -130,7 +130,7 @@ by KATOH Yasufumi Specify the configuration file to configure the virtualization and isolation functionalities for the container. --> - コンテナに設定したい仮想化および隔離機能の設定を行う設定ファイルを指定します. + コンテナに設定したい仮想化および隔離機能の設定を行う設定ファイルを指定します。 - もしコンテナ作成前に (lxc-create によって) あらかじめ設定ファイルが指定されている場合であっても,指定した設定ファイルが使われます. + もしコンテナ作成前に (lxc-create によって) あらかじめ設定ファイルが指定されている場合であっても、指定した設定ファイルが使われます。 @@ -153,7 +153,7 @@ by KATOH Yasufumi variable KEY. This overrides any assignment done in config_file. --> - 設定変数 KEY の値を VAL に設定します.この設定は config_file で設定された値を上書きします. + 設定変数 KEY の値を VAL に設定します。この設定は config_file で設定された値を上書きします。 @@ -166,8 +166,8 @@ by KATOH Yasufumi processing. Any arguments after the -- are treated as arguments to command. --> - オプション指定の最後の印で,それ以上のオプションの処理を止めます. - -- の後の引数は実行する command の引数として扱われます. + オプション指定の最後の印で、それ以上のオプションの処理を止めます。 + -- の後の引数は実行する command の引数として扱われます。 - このオプションは,command にオプションを指定したいときに,lxc-execute がそのオプションを読み取ってほしくないときに役に立ちます. + このオプションは、command にオプションを指定したいときに、lxc-execute がそのオプションを読み取ってほしくないときに役に立ちます。 @@ -200,7 +200,7 @@ by KATOH Yasufumi application. You should stop it before reuse this container or create a new one. --> - 指定したコンテナが既にアプリケーションを実行中の場合.コンテナを再使用したり,新しく作成する前にコンテナを止める必要があります. + 指定したコンテナが既にアプリケーションを実行中の場合。コンテナを再使用したり、新しく作成する前にコンテナを止める必要があります。 diff --git a/doc/ja/lxc-freeze.sgml.in b/doc/ja/lxc-freeze.sgml.in index f38eb782a8..93b352cf21 100644 --- a/doc/ja/lxc-freeze.sgml.in +++ b/doc/ja/lxc-freeze.sgml.in @@ -70,9 +70,9 @@ by KATOH Yasufumi command. This command is useful for batch managers to schedule a group of processes. --> - lxc-freeze は,コンテナ内部で実行中のプロセスを全て凍結します. - プロセスは lxc-unfreeze コマンドによって明示的に解凍されるまでブロックされます. - このコマンドはプロセスのグループをスケジューリングするバッチマネージャに便利なコマンドです. + lxc-freeze は、コンテナ内部で実行中のプロセスを全て凍結します。 + プロセスは lxc-unfreeze コマンドによって明示的に解凍されるまでブロックされます。 + このコマンドはプロセスのグループをスケジューリングするバッチマネージャに便利なコマンドです。 @@ -92,7 +92,7 @@ by KATOH Yasufumi The specified container was not created before with the lxc-create command. --> - 指定したコンテナが lxc-create で作成されておらず存在しません. + 指定したコンテナが lxc-create で作成されておらず存在しません。 diff --git a/doc/ja/lxc-info.sgml.in b/doc/ja/lxc-info.sgml.in index 0f09c4a102..8df1928fe6 100644 --- a/doc/ja/lxc-info.sgml.in +++ b/doc/ja/lxc-info.sgml.in @@ -70,7 +70,7 @@ by KATOH Yasufumi lxc-info queries and shows information about a container. --> - lxc-info は,コンテナに関する情報を問い合わせ,表示します. + lxc-info は、コンテナに関する情報を問い合わせ、表示します。 @@ -88,7 +88,7 @@ by KATOH Yasufumi Print a configuration key from the container. This option may be given mulitple times to print out multiple key = value pairs. --> - コンテナの設定値を表示します.このオプションは複数の key = value のペアを表示したい場合には複数回指定することも可能です. + コンテナの設定値を表示します。このオプションは複数の key = value のペアを表示したい場合には複数回指定することも可能です。 @@ -102,7 +102,7 @@ by KATOH Yasufumi - コンテナの状態のみを表示します. + コンテナの状態のみを表示します。 @@ -116,7 +116,7 @@ by KATOH Yasufumi - コンテナの pid を表示します. + コンテナの pid を表示します。 @@ -130,7 +130,7 @@ by KATOH Yasufumi - コンテナの IP アドレスを表示します.. + コンテナの IP アドレスを表示します。。 @@ -156,18 +156,18 @@ by KATOH Yasufumi 5 . --> - コンテナの統計情報を表示します. - パフォーマンスへの影響を考慮して,カーネルメモリの使用量は,カーネルメモリの制限値が設定されない限りはカウントされません. - もし,制限が設定されていない場合,lxc-info はカーネルメモリの使用量を 0 と表示します.制限は + コンテナの統計情報を表示します。 + パフォーマンスへの影響を考慮して、カーネルメモリの使用量は、カーネルメモリの制限値が設定されない限りはカウントされません。 + もし、制限が設定されていない場合、lxc-info はカーネルメモリの使用量を 0 と表示します。制限は lxc.cgroup.memory.kmem.limit_in_bytes = number - のように,コンテナの設定ファイルで指定することができます.詳しくは, + のように、コンテナの設定ファイルで指定することができます。詳しくは、 lxc.conf 5 - を参照してください. + を参照してください。 @@ -182,8 +182,8 @@ by KATOH Yasufumi Print the container's statistics in raw, non-humanized form. The default is to print statistics in humanized form. --> - コンテナの統計情報を人間が読みやすい形に加工しないでそのまま表示します. - デフォルトは人間が読みやすい形の統計情報を表示します. + コンテナの統計情報を人間が読みやすい形に加工しないでそのまま表示します。 + デフォルトは人間が読みやすい形の統計情報を表示します。 @@ -202,7 +202,7 @@ by KATOH Yasufumi - foo という名前のコンテナの情報を表示します. + foo という名前のコンテナの情報を表示します。 @@ -214,7 +214,7 @@ by KATOH Yasufumi - ubuntu という文字列で始まる名前の全てのコンテナの情報を表示します. + ubuntu という文字列で始まる名前の全てのコンテナの情報を表示します。 @@ -226,7 +226,7 @@ by KATOH Yasufumi - コンテナ foo の veth pair を表示します. + コンテナ foo の veth pair を表示します。 diff --git a/doc/ja/lxc-ls.sgml.in b/doc/ja/lxc-ls.sgml.in index 3ca1e787b7..3478451e9a 100644 --- a/doc/ja/lxc-ls.sgml.in +++ b/doc/ja/lxc-ls.sgml.in @@ -73,7 +73,7 @@ by KATOH Yasufumi lxc-ls list the containers existing on the system. --> - lxc-ls はシステム上に存在するコンテナをリスト表示します. + lxc-ls はシステム上に存在するコンテナをリスト表示します。 @@ -89,7 +89,7 @@ by KATOH Yasufumi - 1 行に 1 エントリ表示します.(/dev/stdout が tty でない場合のデフォルト) + 1 行に 1 エントリ表示します。(/dev/stdout が tty でない場合のデフォルト) @@ -103,7 +103,7 @@ by KATOH Yasufumi - アクティブなコンテナのみリスト表示します.(--frozen --running と同じです) + アクティブなコンテナのみリスト表示します。(--frozen --running と同じです) @@ -117,7 +117,7 @@ by KATOH Yasufumi - 凍結 (frozen) 状態のコンテナのみをリスト表示します. + 凍結 (frozen) 状態のコンテナのみをリスト表示します。 @@ -131,7 +131,7 @@ by KATOH Yasufumi - 実行 (running) 状態のコンテナのみをリスト表示します. + 実行 (running) 状態のコンテナのみをリスト表示します。 @@ -145,7 +145,7 @@ by KATOH Yasufumi - 停止状態のコンテナのみをリスト表示します. + 停止状態のコンテナのみをリスト表示します。 @@ -159,7 +159,7 @@ by KATOH Yasufumi - 装飾付きのカラムベースの出力を使用します. + 装飾付きのカラムベースの出力を使用します。 @@ -175,8 +175,8 @@ by KATOH Yasufumi Valid values are: name, state, ipv4, ipv6 and pid Default is: name,state,ipv4,ipv6 --> - 装飾付き出力で表示するカラムのコンマ区切りのリスト. - 有効な値は name,state,ipv4,ipv6,pid. + 装飾付き出力で表示するカラムのコンマ区切りのリスト。 + 有効な値は name,state,ipv4,ipv6,pid。 デフォルトは name,state,ipv4,ipv6 @@ -191,7 +191,7 @@ by KATOH Yasufumi - ネストされたコンテナを表示します. + ネストされたコンテナを表示します。 @@ -206,8 +206,8 @@ by KATOH Yasufumi The filter passed to lxc-ls will be applied to the container name. The format is a regular expression. --> - コンテナ名に対して適用する lxc-ls に与えるフィルタ. - フォーマットは正規表現です. + コンテナ名に対して適用する lxc-ls に与えるフィルタ。 + フォーマットは正規表現です。 @@ -227,8 +227,8 @@ by KATOH Yasufumi list all the containers, listing one per line along with its name, state, ipv4 and ipv6 addresses. --> - 全てのコンテナをリスト表示します. - 一行にはコンテナの名前,状態,IPv4 アドレス,IPv6 アドレスが表示されます. + 全てのコンテナをリスト表示します。 + 一行にはコンテナの名前、状態、IPv4 アドレス、IPv6 アドレスが表示されます。 @@ -240,7 +240,7 @@ by KATOH Yasufumi - 稼働中のコンテナを一列にリスト表示します. + 稼働中のコンテナを一列にリスト表示します。 diff --git a/doc/ja/lxc-monitor.sgml.in b/doc/ja/lxc-monitor.sgml.in index c04e842f1f..e2794a614d 100644 --- a/doc/ja/lxc-monitor.sgml.in +++ b/doc/ja/lxc-monitor.sgml.in @@ -73,10 +73,10 @@ by KATOH Yasufumi name will default to '.*' which will monitor all containers in lxcpath. --> - lxc-monitor はコンテナの状態を監視します. - name をモニタ対象のコンテナを指定するために使うことも可能です. - これは posix2 準拠の正規表現であり,全てのコンテナの監視を行ったり,いくつかのコンテナの監視を行ったり,1 つだけのコンテナの監視を行ったりすることが可能です. - name を指定しない場合,デフォルトで '.*' となり,lxcpath 以下の全てのコンテナの監視を行います. + lxc-monitor はコンテナの状態を監視します。 + name をモニタ対象のコンテナを指定するために使うことも可能です。 + これは posix2 準拠の正規表現であり、全てのコンテナの監視を行ったり、いくつかのコンテナの監視を行ったり、1 つだけのコンテナの監視を行ったりすることが可能です。 + name を指定しない場合、デフォルトで '.*' となり、lxcpath 以下の全てのコンテナの監視を行います。 @@ -86,8 +86,8 @@ by KATOH Yasufumi containers with the same name in multiple paths will be indistinguishable in the output. --> - 1 つ以上のコンテナパスをモニタリングするために,複数回の =PATH オプションを指定することが可能です. - しかし,複数のパスに同じ名前のコンテナが存在する場合は,出力の見分けがつかない事に注意が必要です. + 1 つ以上のコンテナパスをモニタリングするために、複数回の =PATH オプションを指定することが可能です。 + しかし、複数のパスに同じ名前のコンテナが存在する場合は、出力の見分けがつかない事に注意が必要です。 @@ -109,9 +109,9 @@ by KATOH Yasufumi normal 30 seconds for new clients. This is useful if you need to unmount the filesystem lxcpath is on. --> - 指定したそれぞれの lxcpath に対する lxc-monitord デーモンを終了させる要求を行います. - lxc-monitord は通常は新しいクライアントを 30 秒待ちますが,このコマンドを受け取ると,クライアントがいなくなるとすぐに終了します. - このオプションは,lxcpath のファイルシステムをアンマウントする必要があるときに役に立ちます. + 指定したそれぞれの lxcpath に対する lxc-monitord デーモンを終了させる要求を行います。 + lxc-monitord は通常は新しいクライアントを 30 秒待ちますが、このコマンドを受け取ると、クライアントがいなくなるとすぐに終了します。 + このオプションは、lxcpath のファイルシステムをアンマウントする必要があるときに役に立ちます。 @@ -130,7 +130,7 @@ by KATOH Yasufumi - foo という名前のコンテナの様々な状態を監視します. + foo という名前のコンテナの様々な状態を監視します。 @@ -142,7 +142,7 @@ by KATOH Yasufumi - foo と bar という名前のコンテナの様々な状態を監視します. + foo と bar という名前のコンテナの様々な状態を監視します。 @@ -155,7 +155,7 @@ by KATOH Yasufumi will monitor the different states for container with the name beginning with letter 'f' or 'b'. --> - 'f' もしくは 'b' という文字で始まるコンテナの様々な状態を監視します. + 'f' もしくは 'b' という文字で始まるコンテナの様々な状態を監視します。 @@ -167,7 +167,7 @@ by KATOH Yasufumi - 全てのコンテナの様々な状態を監視します. + 全てのコンテナの様々な状態を監視します。 @@ -188,7 +188,7 @@ by KATOH Yasufumi The specified container was not created before with the lxc-create command. --> - 指定したコンテナが lxc-create で作成されておらず存在しません. + 指定したコンテナが lxc-create で作成されておらず存在しません。 diff --git a/doc/ja/lxc-snapshot.sgml.in b/doc/ja/lxc-snapshot.sgml.in index d18a45125a..2c23503d48 100644 --- a/doc/ja/lxc-snapshot.sgml.in +++ b/doc/ja/lxc-snapshot.sgml.in @@ -79,14 +79,14 @@ by KATOH Yasufumi lxc-snapshot creates, lists, and restores container snapshots. --> - lxc-snapshot はコンテナのスナップショットの作製,スナップショットのリスト表示,スナップショットからのリストアを行います. + lxc-snapshot はコンテナのスナップショットの作製、スナップショットのリスト表示、スナップショットからのリストアを行います。 - スナップショットは,専用の設定されたパス以下にスナップショット化されたコンテナとして保存されます. - 例えば,もしコンテナパスが /var/lib/lxc で,コンテナが c1 である場合,最初に取得するスナップショットは,パス /var/lib/lxcsnaps/c1 の下の snap0 として保存されます. + スナップショットは、専用の設定されたパス以下にスナップショット化されたコンテナとして保存されます。 + 例えば、もしコンテナパスが /var/lib/lxc で、コンテナが c1 である場合、最初に取得するスナップショットは、パス /var/lib/lxcsnaps/c1 の下の snap0 として保存されます。 @@ -103,7 +103,7 @@ by KATOH Yasufumi - 新しく作製するスナップショットに comment_file ファイル内のコメントを関連付ける. + 新しく作製するスナップショットに comment_file ファイル内のコメントを関連付ける。 @@ -115,7 +115,7 @@ by KATOH Yasufumi - 存在するスナップショットをリスト表示します. + 存在するスナップショットをリスト表示します。 @@ -127,7 +127,7 @@ by KATOH Yasufumi - スナップショットのリスト表示でスナップショットに対するコメントを表示します. + スナップショットのリスト表示でスナップショットに対するコメントを表示します。 @@ -139,8 +139,8 @@ by KATOH Yasufumi - 指定のスナップショットをリストアします. - これはスナップショットのコピーである完全に新しいコンテナが作製されるということです. + 指定のスナップショットをリストアします。 + これはスナップショットのコピーである完全に新しいコンテナが作製されるということです。 @@ -152,9 +152,9 @@ by KATOH Yasufumi - スナップショットをリストアする際,最後のオプション引数はリストアされたコンテナの名前として使用されます. - もし名前が与えられてない場合,元のコンテナが破壊され,リストアされるコンテナに置き換えられます. - スナップショット元を削除することは,aufs, overlayfs, zfs がバックエンドのスナップショットでは出来ないことに注意が必要です. + スナップショットをリストアする際、最後のオプション引数はリストアされたコンテナの名前として使用されます。 + もし名前が与えられてない場合、元のコンテナが破壊され、リストアされるコンテナに置き換えられます。 + スナップショット元を削除することは、aufs, overlayfs, zfs がバックエンドのスナップショットでは出来ないことに注意が必要です。 diff --git a/doc/ja/lxc-start-ephemeral.sgml.in b/doc/ja/lxc-start-ephemeral.sgml.in index c673c167e3..eca2a8bef3 100644 --- a/doc/ja/lxc-start-ephemeral.sgml.in +++ b/doc/ja/lxc-start-ephemeral.sgml.in @@ -72,7 +72,7 @@ by KATOH Yasufumi lxc-start-ephemeral start an ephemeral copy of an existing container. --> - lxc-start-ephemeral は,存在するコンテナの一時的なコピーからコンテナを起動します. + lxc-start-ephemeral は、存在するコンテナの一時的なコピーからコンテナを起動します。 @@ -117,8 +117,8 @@ by KATOH Yasufumi Start the container in background and print the name and IP. This option can't be used if a command is passed. --> - コンテナをバックグラウンドで実行し,名前と IP アドレスを表示します. - このオプションはコマンドを実行させたいときには使用することはできません. + コンテナをバックグラウンドで実行し、名前と IP アドレスを表示します。 + このオプションはコマンドを実行させたいときには使用することはできません。 @@ -133,8 +133,8 @@ by KATOH Yasufumi Directory to bind mount into container. Can be passed multiple times. --> - コンテナ内にバインドマウントするためのディレクトリ. - 複数回指定できます. + コンテナ内にバインドマウントするためのディレクトリ。 + 複数回指定できます。 @@ -149,8 +149,8 @@ by KATOH Yasufumi The user to connect to the container as. Used when passing a command to lxc-start-ephemeral. --> - コンテナに接続するためのユーザ. - lxc-start-ephemeral にコマンドを指定するときに使います. + コンテナに接続するためのユーザ。 + lxc-start-ephemeral にコマンドを指定するときに使います。 @@ -164,7 +164,7 @@ by KATOH Yasufumi - コンテナ内にコピーする既存の SSH 公開鍵. + コンテナ内にコピーする既存の SSH 公開鍵。 @@ -179,8 +179,8 @@ by KATOH Yasufumi Force a specific union file system. Can be one of: overlayfs aufs --> - 指定した union ファイルシステムを使用します. - overlayfs か aufs のどちらかが使用できます. + 指定した union ファイルシステムを使用します。 + overlayfs か aufs のどちらかが使用できます。 @@ -196,7 +196,7 @@ by KATOH Yasufumi With this option, you can lxc-stop and lxc-start the no longer so ephemeral container (it's still an overlay, but a persistent one). --> - tmpfs の代わりに永続的なバックエンドを使用します.このオプションを使うことにより,もはや一時的なコンテナではないので,lxc-stop や lxc-start を使用することができます (オーバーレイな状態ですが,永続的です). + tmpfs の代わりに永続的なバックエンドを使用します。このオプションを使うことにより、もはや一時的なコンテナではないので、lxc-stop や lxc-start を使用することができます (オーバーレイな状態ですが、永続的です)。 @@ -212,7 +212,7 @@ by KATOH Yasufumi This currently uses ssh (not attach) and is incompatible with daemon mode. --> - 即座に指定したコマンドをコンテナ内で実行します.現時点では (attach ではなく) ssh を使用します.そしてデーモンモードと両方を指定することはできません. + 即座に指定したコマンドをコンテナ内で実行します。現時点では (attach ではなく) ssh を使用します。そしてデーモンモードと両方を指定することはできません。 @@ -241,8 +241,8 @@ by KATOH Yasufumi Simply start an ephemeral container and attach to the console. This container will be based on existing container "p1". --> - 単に一時的なコンテナを開始させ,コンソールにアタッチします. - このコンテナは "p1" という既存のコンテナを基にします. + 単に一時的なコンテナを開始させ、コンソールにアタッチします。 + このコンテナは "p1" という既存のコンテナを基にします。 @@ -255,7 +255,7 @@ by KATOH Yasufumi Start an ephemeral container based on p1 called p1-ephemeral and print its IP and name to the console instead of attaching. --> - p1 を基にした一時的なコンテナを開始し,コンソールにアタッチする代わりに IP アドレスと名前を表示します. + p1 を基にした一時的なコンテナを開始し、コンソールにアタッチする代わりに IP アドレスと名前を表示します。 diff --git a/doc/ja/lxc-start.sgml.in b/doc/ja/lxc-start.sgml.in index 24116730fe..76b3b7d361 100644 --- a/doc/ja/lxc-start.sgml.in +++ b/doc/ja/lxc-start.sgml.in @@ -77,7 +77,7 @@ by KATOH Yasufumi command inside the container specified by name. --> - lxc-startcommand で指定されたコマンドを,name で指定されたコンテナ内で実行します. + lxc-startcommand で指定されたコマンドを、name で指定されたコンテナ内で実行します。 - このコマンドは,lxc-create コマンドもしくは設定ファイルのパラメータであらかじめ定義された設定に従ってコンテナをセットアップします. - もし設定が定義されていない場合は,デフォルトの隔離状態を使用します. + このコマンドは、lxc-create コマンドもしくは設定ファイルのパラメータであらかじめ定義された設定に従ってコンテナをセットアップします。 + もし設定が定義されていない場合は、デフォルトの隔離状態を使用します。 - もし command が指定されない場合は,lxc-start はシステムコンテナを実行するためのコマンドとして,デフォルトで "/sbin/init" を使用します. + もし command が指定されない場合は、lxc-start はシステムコンテナを実行するためのコマンドとして、デフォルトで "/sbin/init" を使用します。 @@ -119,9 +119,9 @@ by KATOH Yasufumi more tty, if an error occurs nothing will be displayed, the log file can be used to check the error. --> - コンテナをデーモンとして実行します. - コンテナはそれ以上の tty を持ちませんので,もしエラーが起きても何も表示されません. - エラーのチェックにはログファイルを使用することができます. + コンテナをデーモンとして実行します。 + コンテナはそれ以上の tty を持ちませんので、もしエラーが起きても何も表示されません。 + エラーのチェックにはログファイルを使用することができます。 @@ -135,7 +135,7 @@ by KATOH Yasufumi - プロセス ID を含むファイルを作製します. + プロセス ID を含むファイルを作製します。 @@ -150,7 +150,7 @@ by KATOH Yasufumi Specify the configuration file to configure the virtualization and isolation functionalities for the container. --> - コンテナの仮想化,隔離機能の設定のための設定ファイルを指定します. + コンテナの仮想化、隔離機能の設定のための設定ファイルを指定します。 - (lxc-create 経由で) 前もってコンテナが作られた際の設定ファイルが既にあった場合でも,このオプションが指定された場合は,指定した設定ファイルが使用されます. + (lxc-create 経由で) 前もってコンテナが作られた際の設定ファイルが既にあった場合でも、このオプションが指定された場合は、指定した設定ファイルが使用されます。 @@ -175,8 +175,8 @@ by KATOH Yasufumi /dev/tty8. If this option is not specified the current terminal will be used unless is specified. --> - コンテナのコンソールに使用するデバイスを指定します.例えば /dev/tty8 のように指定します. - このオプションが指定されない時は, が指定されない限りは,現在のターミナルを使用します. + コンテナのコンソールに使用するデバイスを指定します。例えば /dev/tty8 のように指定します。 + このオプションが指定されない時は、 が指定されない限りは、現在のターミナルを使用します。 @@ -191,7 +191,7 @@ by KATOH Yasufumi - コンテナのコンソール出力のログを出力するファイルを指定します. + コンテナのコンソール出力のログを出力するファイルを指定します。 @@ -207,8 +207,8 @@ by KATOH Yasufumi variable KEY. This overrides any assignment done in config_file. --> - 設定変数 KEY に対する設定値として VAL を設定します. - この設定は,config_file で既に設定されている値も上書きします. + 設定変数 KEY に対する設定値として VAL を設定します。 + この設定は、config_file で既に設定されている値も上書きします。 @@ -226,9 +226,9 @@ by KATOH Yasufumi failure instead. Note: --daemon implies --close-all-fds. --> - 継承しているファイルディスクリプタが存在する場合,それをクローズします. - このオプションが指定されない場合,lxc-start の実行は失敗して終了します. - 注意: --daemon オプションは,--close-all-fds オプションを指定しなくても指定している場合と同様の動きをします. + 継承しているファイルディスクリプタが存在する場合、それをクローズします。 + このオプションが指定されない場合、lxc-start の実行は失敗して終了します。 + 注意: --daemon オプションは、--close-all-fds オプションを指定しなくても指定している場合と同様の動きをします。 @@ -247,9 +247,9 @@ by KATOH Yasufumi network configuration of the starting container is ignored and the up/down scripts won't be executed. --> - 名前が name である,もしくは PID が pid であるコンテナとネットワーク名前空間を共有します. - ネットワーク名前空間は引き続き元の所有者が管理します. - 開始するコンテナのネットワーク設定は無視され,up/down のスクリプトは実行されません. + 名前が name である、もしくは PID が pid であるコンテナとネットワーク名前空間を共有します。 + ネットワーク名前空間は引き続き元の所有者が管理します。 + 開始するコンテナのネットワーク設定は無視され、up/down のスクリプトは実行されません。 @@ -265,7 +265,7 @@ by KATOH Yasufumi a name container or a pid. --> - 名前が name である,もしくは PID が pid であるコンテナと IPC 名前空間を共有します. + 名前が name である、もしくは PID が pid であるコンテナと IPC 名前空間を共有します。 @@ -283,8 +283,8 @@ by KATOH Yasufumi not set the hostname, but the container OS may do it anyway. --> - 名前が name である,もしくは PID が pid であるコンテナと UTS 名前空間を共有します. - LXC は開始するときににはホスト名を設定しませんが,コンテナ内の OS が何らかの方法でホスト名を設定するかもしれません. + 名前が name である、もしくは PID が pid であるコンテナと UTS 名前空間を共有します。 + LXC は開始するときににはホスト名を設定しませんが、コンテナ内の OS が何らかの方法でホスト名を設定するかもしれません。 @@ -309,8 +309,8 @@ by KATOH Yasufumi application. You should stop it before reuse this container or create a new one. --> - 指定したコンテナは既に実行済みです. - このコンテナを使用する前に既に起動しているコンテナを停止するか,新しいものを作成する必要があります. + 指定したコンテナは既に実行済みです。 + このコンテナを使用する前に既に起動しているコンテナを停止するか、新しいものを作成する必要があります。 diff --git a/doc/ja/lxc-stop.sgml.in b/doc/ja/lxc-stop.sgml.in index 524ba8bffe..aed1947c33 100644 --- a/doc/ja/lxc-stop.sgml.in +++ b/doc/ja/lxc-stop.sgml.in @@ -79,9 +79,9 @@ by KATOH Yasufumi 60 seconds, it will be sent the lxc.stopsignal (defaults to SIGKILL) to force it to shut down. --> - lxc-stop は,リブート,クリーンシャットダウン,コンテナ内の全てのプロセスの kill のどれかを行います. - デフォルトでは,コンテナのクリーンなシャットダウンを lxc.haltsignal (デフォルトでは SIGPWR) をコンテナの init プロセスに送ることでリクエストし,コンテナの終了を 60 秒待ち,return します. - コンテナが 60 秒の間にクリーンに終了するのに失敗した場合,lxc.stopsignal (デフォルトでは SIGKILL) を送り,強制的にシャットダウンします. + lxc-stop は、リブート、クリーンシャットダウン、コンテナ内の全てのプロセスの kill のどれかを行います。 + デフォルトでは、コンテナのクリーンなシャットダウンを lxc.haltsignal (デフォルトでは SIGPWR) をコンテナの init プロセスに送ることでリクエストし、コンテナの終了を 60 秒待ち、return します。 + コンテナが 60 秒の間にクリーンに終了するのに失敗した場合、lxc.stopsignal (デフォルトでは SIGKILL) を送り、強制的にシャットダウンします。 @@ -94,9 +94,9 @@ by KATOH Yasufumi -t TIMEOUT specifies the maximum amount of time to wait for the container to complete the shutdown or reboot. --> - -W, -r, -s, -k, --nokill オプションは実行する際のアクションを指定します. - -W は,指定したアクションの後に,lxc-stop は速やかに終了します. - 一方,-t TIMEOUT はコンテナが完全にシャットダウンやリブートするのを待つ時間の最大値を設定します. + -W, -r, -s, -k, --nokill オプションは実行する際のアクションを指定します。 + -W は、指定したアクションの後に、lxc-stop は速やかに終了します。 + 一方、-t TIMEOUT はコンテナが完全にシャットダウンやリブートするのを待つ時間の最大値を設定します。 @@ -114,7 +114,7 @@ by KATOH Yasufumi - コンテナのリブートをリクエストします. + コンテナのリブートをリクエストします。 @@ -130,8 +130,8 @@ by KATOH Yasufumi kill all tasks in the container. This is the legacy lxc-stop behavior. --> - コンテナのクリーンシャットダウンをリクエストするのでなく,明確にコンテナ内の全てのタスクを kill します. - これは,以前の lxc-stop の動作です. + コンテナのクリーンシャットダウンをリクエストするのでなく、明確にコンテナ内の全てのタスクを kill します。 + これは、以前の lxc-stop の動作です。 @@ -146,8 +146,8 @@ by KATOH Yasufumi Only request a clean shutdown, do not kill the container tasks if the clean shutdown fails. --> - クリーンなシャットダウンのみをリクエストします. - クリーンなシャットダウンに失敗した場合でも,コンテナのタスクを kill しません. + クリーンなシャットダウンのみをリクエストします。 + クリーンなシャットダウンに失敗した場合でも、コンテナのタスクを kill しません。 @@ -163,8 +163,8 @@ by KATOH Yasufumi only be used if lxc-stop is hanging due to a bad system state. --> - このオプションはいかなる場合でも API の lxc のロックの使用を回避します. - システム状態が不良な場合に lxc-stop の応答がない状態の場合のみ使用すべきです. + このオプションはいかなる場合でも API の lxc のロックの使用を回避します。 + システム状態が不良な場合に lxc-stop の応答がない状態の場合のみ使用すべきです。 @@ -179,7 +179,7 @@ by KATOH Yasufumi Simply perform the requestion action (reboot, shutdown, or hard kill) and exit. --> - リクエストされたアクション (reboot, shutdown, 強制的な kill) を実行するだけで (すぐに) 終了 (exit) します. + リクエストされたアクション (reboot, shutdown, 強制的な kill) を実行するだけで (すぐに) 終了 (exit) します。 @@ -193,7 +193,7 @@ by KATOH Yasufumi - コンテナの強制停止まで TIMEOUT 秒待ちます. + コンテナの強制停止まで TIMEOUT 秒待ちます。 @@ -213,7 +213,7 @@ by KATOH Yasufumi - コンテナの停止が成功しました. + コンテナの停止が成功しました。 @@ -225,7 +225,7 @@ by KATOH Yasufumi - コンテナの停止中にエラーが発生しました. + コンテナの停止中にエラーが発生しました。 @@ -237,7 +237,7 @@ by KATOH Yasufumi - 指定のコンテナは存在しますが,実行中ではありません. + 指定のコンテナは存在しますが、実行中ではありません。 @@ -258,7 +258,7 @@ by KATOH Yasufumi The specified container was not created before with the lxc-create command. --> - 指定したコンテナが lxc-create で作成されておらず存在しません. + 指定したコンテナが lxc-create で作成されておらず存在しません。 diff --git a/doc/ja/lxc-top.sgml.in b/doc/ja/lxc-top.sgml.in index aba354be79..38e8f10685 100644 --- a/doc/ja/lxc-top.sgml.in +++ b/doc/ja/lxc-top.sgml.in @@ -68,8 +68,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA number of containers displayed, otherwise lxc-top will display as many containers as can fit in your terminal. --> - lxc-top はコンテナの統計情報を表示します.出力は delay 秒ごとに更新されます. - そして,sortby で指定した値に従ってソートされます.count を指定すると表示するコンテナ数を制限しますが,指定しなければ使用しているターミナルに合うようなコンテナ数で表示します. + lxc-top はコンテナの統計情報を表示します。出力は delay 秒ごとに更新されます。 + そして、sortby で指定した値に従ってソートされます。count を指定すると表示するコンテナ数を制限しますが、指定しなければ使用しているターミナルに合うようなコンテナ数で表示します。 @@ -87,7 +87,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Limit the number of containers displayed to count. --> - 表示するコンテナ数を count に制限します. + 表示するコンテナ数を count に制限します。 @@ -104,8 +104,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA rational number, for example 0.5 for a half second delay. The default is 3 seconds. --> - 表示を更新する間隔を秒で指定します.有理数を指定することにより,1 秒以下を指定することも可能です. - 例えば,1 秒の半分で更新を行うために 0.5 を指定します.デフォルトは 3 秒です. + 表示を更新する間隔を秒で指定します。有理数を指定することにより、1 秒以下を指定することも可能です。 + 例えば、1 秒の半分で更新を行うために 0.5 を指定します。デフォルトは 3 秒です。 @@ -121,8 +121,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA the letters n,c,d,m,k to sort by name, cpu use, disk I/O, memory, or kernel memory use respectively. The default is 'n'. --> - 名前,CPU 使用量,メモリ使用量でコンテナをソートします.sortby で指定する引数は n,c,d,m,k のどれかでなければなりません. - これはそれぞれ名前,CPU 使用量,disk I/O,メモリ使用量,カーネルメモリ使用量を表します.デフォルトは 'n' です. + 名前、CPU 使用量、メモリ使用量でコンテナをソートします。sortby で指定する引数は n,c,d,m,k のどれかでなければなりません。 + これはそれぞれ名前、CPU 使用量、disk I/O、メモリ使用量、カーネルメモリ使用量を表します。デフォルトは 'n' です。 @@ -137,7 +137,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ascending alphabetical order and values sort in descending amounts (ie. largest value first). --> - デフォルトのソート順を逆転させます.デフォルトでは,名前のソートはアルファベットの昇順,値のソートは量の降順 (最も大きい数が最初) です. + デフォルトのソート順を逆転させます。デフォルトでは、名前のソートはアルファベットの昇順、値のソートは量の降順 (最も大きい数が最初) です。 @@ -154,7 +154,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - コンテナを 1 秒ごとに更新し,メモリ使用量でソートして表示します. + コンテナを 1 秒ごとに更新し、メモリ使用量でソートして表示します。 @@ -179,18 +179,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 5 . --> - パフォーマンスへの影響を考慮して,カーネルメモリの使用量は,カーネルメモリの制限値が設定されない限りはカウントされません. - もし,制限が設定されていない場合,lxc-top はカーネルメモリの使用量を 0 と表示します. - もし,カウントされているコンテナが存在しない場合,KMem カラムは表示されません.制限は + パフォーマンスへの影響を考慮して、カーネルメモリの使用量は、カーネルメモリの制限値が設定されない限りはカウントされません。 + もし、制限が設定されていない場合、lxc-top はカーネルメモリの使用量を 0 と表示します。 + もし、カウントされているコンテナが存在しない場合、KMem カラムは表示されません。制限は lxc.cgroup.memory.kmem.limit_in_bytes = number - のように,コンテナの設定ファイルで指定することができます.詳しくは, + のように、コンテナの設定ファイルで指定することができます。詳しくは、 lxc.conf 5 - を参照してください. + を参照してください。 diff --git a/doc/ja/lxc-unfreeze.sgml.in b/doc/ja/lxc-unfreeze.sgml.in index b4fe0f6e47..9a66b93812 100644 --- a/doc/ja/lxc-unfreeze.sgml.in +++ b/doc/ja/lxc-unfreeze.sgml.in @@ -67,7 +67,7 @@ by KATOH Yasufumi lxc-unfreeze will thaw all the processes previously frozen by the lxc-freeze command. --> - lxc-unfreeze は,先に lxc-freeze を使って凍結した全てのプロセスを解凍します. + lxc-unfreeze は、先に lxc-freeze を使って凍結した全てのプロセスを解凍します。 @@ -87,7 +87,7 @@ by KATOH Yasufumi The specified container was not created before with the lxc-create command. --> - 指定したコンテナが lxc-create で作成されておらず存在しません. + 指定したコンテナが lxc-create で作成されておらず存在しません。 diff --git a/doc/ja/lxc-unshare.sgml.in b/doc/ja/lxc-unshare.sgml.in index 1d049123a0..815dd6cda9 100644 --- a/doc/ja/lxc-unshare.sgml.in +++ b/doc/ja/lxc-unshare.sgml.in @@ -77,10 +77,10 @@ by KATOH Yasufumi the new task with fresh namespaces. Apart from testing kernel regressions this should make no difference. --> - lxc-unshare はクローンされた名前空間の組の中でタスクを実行するのに使います. - このコマンドは主にテスト目的で使います. - このような名前であるにもかかわらず,このコマンドは常に,新しい名前空間で新しいタスクを作成するために unshare ではなく clone を使います. - テスト中のカーネルの退行は別として,これで違いは生じないはずです. + lxc-unshare はクローンされた名前空間の組の中でタスクを実行するのに使います。 + このコマンドは主にテスト目的で使います。 + このような名前であるにもかかわらず、このコマンドは常に、新しい名前空間で新しいタスクを作成するために unshare ではなく clone を使います。 + テスト中のカーネルの退行は別として、これで違いは生じないはずです。 @@ -108,11 +108,11 @@ by KATOH Yasufumi container while retaining the other namespaces as those of the host. --> - アタッチする名前空間を,パイプでつなげたリストで指定します. - 例えば NETWORK|IPC のようにです. - 指定できる値は MOUNTPIDUTSNAMEIPCUSER NETWORK です. - これにより,プロセスのコンテキストを変更することができます. - 例えば,コンテナのネットワーク名前空間だけを変更し,他の名前空間をホストのものと同じものに保ったままにするというようなことです. + アタッチする名前空間を、パイプでつなげたリストで指定します。 + 例えば NETWORK|IPC のようにです。 + 指定できる値は MOUNTPIDUTSNAMEIPCUSER NETWORK です。 + これにより、プロセスのコンテキストを変更することができます。 + 例えば、コンテナのネットワーク名前空間だけを変更し、他の名前空間をホストのものと同じものに保ったままにするというようなことです。 @@ -126,7 +126,7 @@ by KATOH Yasufumi - 新しいタスクを実行するユーザを指定します. + 新しいタスクを実行するユーザを指定します。 @@ -141,7 +141,7 @@ by KATOH Yasufumi Set the hostname in the new container. Only allowed if the UTSNAME namespace is set. --> - 新しいコンテナ内でのホスト名を設定します.UTSNAME 名前空間を指定している時のみ有効です. + 新しいコンテナ内でのホスト名を設定します。UTSNAME 名前空間を指定している時のみ有効です。 @@ -158,7 +158,7 @@ by KATOH Yasufumi argument multiple times to move multiple interfaces into container. --> - 指定したインターフェースをコンテナ内に移動させます.ネットワーク (NETWORK) 名前空間を指定している時のみ有効です.複数のインターフェースをコンテナに移動させるために複数回指定することも可能です. + 指定したインターフェースをコンテナ内に移動させます。ネットワーク (NETWORK) 名前空間を指定している時のみ有効です。複数のインターフェースをコンテナに移動させるために複数回指定することも可能です。 @@ -172,7 +172,7 @@ by KATOH Yasufumi - デーモンにします (コマンドはコンテナの終了を待ちません). + デーモンにします (コマンドはコンテナの終了を待ちません)。 @@ -187,7 +187,7 @@ by KATOH Yasufumi Mount default filesystems (/proc /dev/shm and /dev/mqueue) in the container. Only allowed if MOUNT namespace is set. --> - コンテナ内でデフォルトのファイルシステム (/proc, /dev/shm, /dev/mqueue) をマウントします.マウント (MOUNT) 名前空間を指定している時のみ有効です. + コンテナ内でデフォルトのファイルシステム (/proc, /dev/shm, /dev/mqueue) をマウントします。マウント (MOUNT) 名前空間を指定している時のみ有効です。 @@ -207,11 +207,11 @@ by KATOH Yasufumi If the hostname is changed in that shell, the change will not be reflected on the host. --> - 自身の UTS(hostname)名前空間でシェルを起動するには以下のように実行します. + 自身の UTS(hostname)名前空間でシェルを起動するには以下のように実行します。 lxc-unshare -s UTSNAME /bin/bash - もし,そのシェル上でホスト名を変更しても,その変更はホストには反映されません. + もし、そのシェル上でホスト名を変更しても、その変更はホストには反映されません。 - 新しいネットワーク,pid,マウント名前空間でシェルを起動するには以下のように実行します. + 新しいネットワーク、pid、マウント名前空間でシェルを起動するには以下のように実行します。 lxc-unshare -s "NETWORK|PID|MOUNT" /bin/bash - その結果起動するシェルは pid が 1 となり,ネットワークインターフェースがないでしょう. + その結果起動するシェルは pid が 1 となり、ネットワークインターフェースがないでしょう。 そのシェル上で /proc を再マウントした後 mount -t proc proc /proc - ps の出力は,その名前空間内には他のプロセスが存在しない事を表示するでしょう. + ps の出力は、その名前空間内には他のプロセスが存在しない事を表示するでしょう。 - 新しいネットワーク,PID,マウント,ホスト名 (UTS) 名前空間でシェルを起動するには, + 新しいネットワーク、PID、マウント、ホスト名 (UTS) 名前空間でシェルを起動するには、 lxc-unshare -s "NETWORK|PID|MOUNT|UTSNAME" -M -H slave -i veth1 /bin/bash @@ -256,8 +256,8 @@ by KATOH Yasufumi /proc will have been remounted. ps output will show there are no other processes in the namespace. --> - 起動したシェルは PID 1 を持ち,2 つのネットワークインターフェース (lo と veth1) を持ちます. - ホスト名は "slave" となり,/proc は再マウントされます.ps コマンドは,名前空間内には他のプロセスがない状態を表示するでしょう. + 起動したシェルは PID 1 を持ち、2 つのネットワークインターフェース (lo と veth1) を持ちます。 + ホスト名は "slave" となり、/proc は再マウントされます。ps コマンドは、名前空間内には他のプロセスがない状態を表示するでしょう。 diff --git a/doc/ja/lxc-user-nic.sgml.in b/doc/ja/lxc-user-nic.sgml.in index 2c6411bae5..86264722b0 100644 --- a/doc/ja/lxc-user-nic.sgml.in +++ b/doc/ja/lxc-user-nic.sgml.in @@ -48,7 +48,7 @@ by KATOH Yasufumi - NIC を作成し,他のネットワーク名前空間に割り当てる + NIC を作成し、他のネットワーク名前空間に割り当てる @@ -70,7 +70,7 @@ by KATOH Yasufumi lxc-user-nic is a setuid-root program with which unprivileged users may create network interfaces for use by a lxc container. --> - lxc-user-nic は root に setuid されたプログラムで,lxc コンテナが使うネットワークインターフェースを,特権を持たないユーザが作成できます. + lxc-user-nic は root に setuid されたプログラムで、lxc コンテナが使うネットワークインターフェースを、特権を持たないユーザが作成できます。 - このプログラムは,@LXC_USERNIC_CONF@ という設定ファイルを参照して,呼び出したユーザが作成することができるインターフェースの数と,どのブリッジに接続するかを決定します. - また,ユーザが作成したインターフェースの数を @LXC_USERNIC_DB@ を使ってチェックします. - これにより,呼び出したユーザが,インターフェースを割り当てるネットワーク名前空間上で特権を持つことが保証されます. + このプログラムは、@LXC_USERNIC_CONF@ という設定ファイルを参照して、呼び出したユーザが作成することができるインターフェースの数と、どのブリッジに接続するかを決定します。 + また、ユーザが作成したインターフェースの数を @LXC_USERNIC_DB@ を使ってチェックします。 + これにより、呼び出したユーザが、インターフェースを割り当てるネットワーク名前空間上で特権を持つことが保証されます。 @@ -105,7 +105,7 @@ by KATOH Yasufumi The process id for the task to whose network namespace the interface should be attached. --> - インターフェースを割り当てたいネットワーク名前空間を持つタスクのプロセス ID. + インターフェースを割り当てたいネットワーク名前空間を持つタスクのプロセス ID。 @@ -123,9 +123,9 @@ by KATOH Yasufumi to the specified bridge, while the other will be passed into the container. --> - 割り当てるネットワークインターフェースのタイプ.現時点では,veth のみサポートされます. - このタイプを指定すると,それぞれがトンネルのエンドポイントとなる 2 つのインターフェースが作成されます. - 一方のエンドポイントは指定したブリッジに接続され,もう一方はコンテナに割り当てられます. + 割り当てるネットワークインターフェースのタイプ。現時点では、veth のみサポートされます。 + このタイプを指定すると、それぞれがトンネルのエンドポイントとなる 2 つのインターフェースが作成されます。 + 一方のエンドポイントは指定したブリッジに接続され、もう一方はコンテナに割り当てられます。 @@ -140,8 +140,8 @@ by KATOH Yasufumi The bridge to which to attach the network interface, for instance lxcbr0. --> - ネットワークインターフェースを接続するブリッジ. - 例えば lxcbr0 のように指定します. + ネットワークインターフェースを接続するブリッジ。 + 例えば lxcbr0 のように指定します。 @@ -156,8 +156,8 @@ by KATOH Yasufumi The desired interface name in the container. This will be eth0 if unspecified. --> - コンテナ内に作られるインターフェースの名前. - もし指定しない場合,eth0 となります. + コンテナ内に作られるインターフェースの名前。 + もし指定しない場合、eth0 となります。 diff --git a/doc/ja/lxc-usernet.sgml.in b/doc/ja/lxc-usernet.sgml.in index a92fde87b5..158861bc13 100644 --- a/doc/ja/lxc-usernet.sgml.in +++ b/doc/ja/lxc-usernet.sgml.in @@ -60,7 +60,7 @@ by KATOH Yasufumi program lxc-user-nic places on network interfaces which an unprivileged user may create. --> - @LXC_USERNIC_CONF@ は,非特権ユーザが作成する可能性のあるネットワークインターフェースを lxc-user-nic プログラムが割り当てる際の制限を制御します. + @LXC_USERNIC_CONF@ は、非特権ユーザが作成する可能性のあるネットワークインターフェースを lxc-user-nic プログラムが割り当てる際の制限を制御します。 @@ -69,7 +69,7 @@ by KATOH Yasufumi - このファイルは,一行が以下のような形式の複数のエントリを持つ行から構成されます. + このファイルは、一行が以下のような形式の複数のエントリを持つ行から構成されます。 @@ -79,7 +79,7 @@ by KATOH Yasufumi - ここでそれぞれのエントリは以下のような意味を持ちます. + ここでそれぞれのエントリは以下のような意味を持ちます。 @@ -108,7 +108,7 @@ by KATOH Yasufumi is the type of network interface being allowed. Only veth is currently supported. --> - 許可されるネットワークインターフェースのタイプ.現時点では veth のみサポートされます. + 許可されるネットワークインターフェースのタイプ。現時点では veth のみサポートされます。 @@ -123,8 +123,8 @@ by KATOH Yasufumi is the bridge to which the network interfaces may be attached, for instance lxcbr0. --> - ネットワークインターフェースが接続されるブリッジ. - 例えば lxcbr0 のように指定します. + ネットワークインターフェースが接続されるブリッジ。 + 例えば lxcbr0 のように指定します。 @@ -139,8 +139,8 @@ by KATOH Yasufumi is the number of network interfaces of the given type which the given user may attach to the given bridge, for instance 2. --> - 指定したユーザが,指定したブリッジに接続できる,指定した形式のネットワークインターフェースの数. - 例えば 2 のように指定します. + 指定したユーザが、指定したブリッジに接続できる、指定した形式のネットワークインターフェースの数。 + 例えば 2 のように指定します。 diff --git a/doc/ja/lxc-usernsexec.sgml.in b/doc/ja/lxc-usernsexec.sgml.in index 77587cea01..ba231f002b 100644 --- a/doc/ja/lxc-usernsexec.sgml.in +++ b/doc/ja/lxc-usernsexec.sgml.in @@ -68,7 +68,7 @@ by KATOH Yasufumi lxc-usernsexec can be used to run a task as root in a new user namespace. --> - lxc-usernsexec は,新しいユーザ名前空間内で root としてタスクを実行するのに使います. + lxc-usernsexec は、新しいユーザ名前空間内で root としてタスクを実行するのに使います。 @@ -93,9 +93,9 @@ by KATOH Yasufumi first userid as seen on the host; and finally the number of ids to be mapped. --> - ユーザ名前空間内で使うための uid のマッピング.マッピングは,コロンで分けられた 4 つの値から構成されます. - 最初の文字は 'u', 'g', 'b' のどれかで,マッピングが UID, GID, UID と GID の両方のうちのどれに関するものなのかを指定します. - 次はユーザ名前空間内の最初の ID を指定します.その次はホスト上での最初の ID を指定します.最後はマッピングされる ID の数を指定します. + ユーザ名前空間内で使うための uid のマッピング。マッピングは、コロンで分けられた 4 つの値から構成されます。 + 最初の文字は 'u', 'g', 'b' のどれかで、マッピングが UID, GID, UID と GID の両方のうちのどれに関するものなのかを指定します。 + 次はユーザ名前空間内の最初の ID を指定します。その次はホスト上での最初の ID を指定します。最後はマッピングされる ID の数を指定します。 - 複数回のマッピングを指定することも可能です.もしマッピングを指定しない場合,デフォルトでは /etc/subuid, /etc/subgid で許可された全ての範囲の UID, GID が,コンテナ内の 0 から始まる UID, GID にマッピングされます. + 複数回のマッピングを指定することも可能です。もしマッピングを指定しない場合、デフォルトでは /etc/subuid, /etc/subgid で許可された全ての範囲の UID, GID が、コンテナ内の 0 から始まる UID, GID にマッピングされます。 - lxc-usernsexec は,常に名前空間内の 0 に setuid, setgid しようとしますので,名前空間内の UID 0 は必ずマッピングしなければいけないことに注意してください. + lxc-usernsexec は、常に名前空間内の 0 に setuid, setgid しようとしますので、名前空間内の UID 0 は必ずマッピングしなければいけないことに注意してください。 @@ -136,15 +136,15 @@ by KATOH Yasufumi lxc-usernsexec -- /bin/bash --> - 割り当てられた subuid の全てをコンテナ内にマッピングしてシェルを起動するには, + 割り当てられた subuid の全てをコンテナ内にマッピングしてシェルを起動するには、 lxc-usernsexec - のようにしてください./bin/sh とは違うシェルを起動する場合, + のようにしてください。/bin/sh とは違うシェルを起動する場合、 lxc-usernsexec -- /bin/bash - のようにしてください. + のようにしてください。 - あなたの UID が 1000 で,コンテナ内の root を 190000 にマッピングする場合で,あなたの所有するファイルをコンテナ内の root に chown したい場合は,以下のように実行します. + あなたの UID が 1000 で、コンテナ内の root を 190000 にマッピングする場合で、あなたの所有するファイルをコンテナ内の root に chown したい場合は、以下のように実行します。 lxc-usernsexec -m b:0:1000:1 -m b:1:190000:1 -- /bin/chown 1:1 $file - これはあなたの UID をユーザ名前空間の root に,190000 を uid 1 にマッピングしています. - ユーザ名前空間内の root は,名前空間内の全ての ID に対して特権があるため,ホスト上で単純に chown を使えない場合でも,あなたはファイルのオーナーを変更する事が可能です. + これはあなたの UID をユーザ名前空間の root に、190000 を uid 1 にマッピングしています。 + ユーザ名前空間内の root は、名前空間内の全ての ID に対して特権があるため、ホスト上で単純に chown を使えない場合でも、あなたはファイルのオーナーを変更する事が可能です。 diff --git a/doc/ja/lxc-wait.sgml.in b/doc/ja/lxc-wait.sgml.in index 3d365f2342..e51d964e28 100644 --- a/doc/ja/lxc-wait.sgml.in +++ b/doc/ja/lxc-wait.sgml.in @@ -67,8 +67,8 @@ by KATOH Yasufumi lxc-wait waits for a specific container state before exiting, this is useful for scripting. --> - lxc-wait は,コンテナが指定した状態になるのを待って終了します. - スクリプトで使用するときに役に立ちます. + lxc-wait は、コンテナが指定した状態になるのを待って終了します。 + スクリプトで使用するときに役に立ちます。 @@ -86,8 +86,8 @@ by KATOH Yasufumi Specify the container state(s) to wait for. The container states can be ORed to specify several states. --> - 待つ対象のコンテナの状態を指定します. - コンテナの状態として,いくつかの状態を OR で指定することが可能です. + 待つ対象のコンテナの状態を指定します。 + コンテナの状態として、いくつかの状態を OR で指定することが可能です。 @@ -101,7 +101,7 @@ by KATOH Yasufumi - 期待した状態になるまで timeout 秒待ちます. + 期待した状態になるまで timeout 秒待ちます。 @@ -122,7 +122,7 @@ by KATOH Yasufumi - 状態が 'RUNNING' になった時点で終了します. + 状態が 'RUNNING' になった時点で終了します。 @@ -134,7 +134,7 @@ by KATOH Yasufumi - 状態が 'RUNNING' もしくは 'STOPPED' になった時点で終了します. + 状態が 'RUNNING' もしくは 'STOPPED' になった時点で終了します。 @@ -155,7 +155,7 @@ by KATOH Yasufumi The specified container was not created before with the lxc-create command. --> - 指定したコンテナが lxc-create で作成されておらず存在しません. + 指定したコンテナが lxc-create で作成されておらず存在しません。 diff --git a/doc/ja/lxc.conf.sgml.in b/doc/ja/lxc.conf.sgml.in index 856849d052..05f787c362 100644 --- a/doc/ja/lxc.conf.sgml.in +++ b/doc/ja/lxc.conf.sgml.in @@ -59,7 +59,7 @@ by KATOH Yasufumi LXC configuration is split in two parts. Container configuration and system configuration. --> - LXC の設定は 2 つのパートに分かれます.コンテナの設定とシステムの設定です. + LXC の設定は 2 つのパートに分かれます。コンテナの設定とシステムの設定です。 @@ -70,7 +70,7 @@ by KATOH Yasufumi config stored in the container's directory. --> - コンテナの設定は,コンテナのディレクトリ内の config に設定します. + コンテナの設定は、コンテナのディレクトリ内の config に設定します。 @@ -80,7 +80,7 @@ by KATOH Yasufumi as extra default keys coming from the default.conf file. --> - 必要最小限の設定は,コンテナの作成時に選択したテンプレートの推奨するデフォルトと,default.conf ファイルに記載されているデフォルトに追加する設定から生成されます. + 必要最小限の設定は、コンテナの作成時に選択したテンプレートの推奨するデフォルトと、default.conf ファイルに記載されているデフォルトに追加する設定から生成されます。 @@ -90,8 +90,8 @@ by KATOH Yasufumi unprivileged containers at ~/.config/lxc/default.conf. --> - default.conf ファイルは @LXC_DEFAULT_CONFIG@ に置かれます. - 非特権コンテナの場合には ~/.config/lxc/default.conf を使用します. + default.conf ファイルは @LXC_DEFAULT_CONFIG@ に置かれます。 + 非特権コンテナの場合には ~/.config/lxc/default.conf を使用します。 @@ -102,7 +102,7 @@ by KATOH Yasufumi 5 --> - このファイルの書式は以下を参照してください. + このファイルの書式は以下を参照してください。 lxc.container.conf 5 @@ -119,7 +119,7 @@ by KATOH Yasufumi ~/.config/lxc/lxc.conf for unprivileged containers. --> - システムの設定には @LXC_GLOBAL_CONF@ を使用します.非特権コンテナの場合は ~/.config/lxc/lxc.conf を使用します. + システムの設定には @LXC_GLOBAL_CONF@ を使用します。非特権コンテナの場合は ~/.config/lxc/lxc.conf を使用します。 @@ -127,7 +127,7 @@ by KATOH Yasufumi This configuration file is used to set values such as default lookup paths and storage backend settings for LXC. --> - この設定ファイルは LXC のデフォルトパスやストレージバックエンドの設定のような値を設定する時に使用します. + この設定ファイルは LXC のデフォルトパスやストレージバックエンドの設定のような値を設定する時に使用します。 @@ -138,7 +138,7 @@ by KATOH Yasufumi 5 --> - このファイルの書式は以下を参照してください. + このファイルの書式は以下を参照してください。 lxc.system.conf 5 diff --git a/doc/ja/lxc.container.conf.sgml.in b/doc/ja/lxc.container.conf.sgml.in index 3fb923582b..bc5086cf2e 100644 --- a/doc/ja/lxc.container.conf.sgml.in +++ b/doc/ja/lxc.container.conf.sgml.in @@ -68,12 +68,12 @@ by KATOH Yasufumi specified, a new network stack is created for the container and the container can no longer use the network of its ancestor. --> - linux コンテナ (lxc) は,常に使用する前に作成されます. - コンテナは,プロセスがコンテナを使う時に仮想化/隔離するシステムリソースのセットを定義することによって作成します. - デフォルトでは,pid, sysv ipc, マウントポイントが仮想化され,隔離されます. - 他のシステムリソースは,設定ファイルで明確に定義されない限りは,コンテナをまたいで共有されます. - 例えば,もしネットワークが設定されていなければ,コンテナを作成する側とコンテナでネットワークを共有します. - しかし,ネットワークが指定されれば,新しいネットワークスタックがコンテナ用に作成され,コンテナは作成元の環境のネットワークを使いません. + linux コンテナ (lxc) は、常に使用する前に作成されます。 + コンテナは、プロセスがコンテナを使う時に仮想化/隔離するシステムリソースのセットを定義することによって作成します。 + デフォルトでは、pid, sysv ipc, マウントポイントが仮想化され、隔離されます。 + 他のシステムリソースは、設定ファイルで明確に定義されない限りは、コンテナをまたいで共有されます。 + 例えば、もしネットワークが設定されていなければ、コンテナを作成する側とコンテナでネットワークを共有します。 + しかし、ネットワークが指定されれば、新しいネットワークスタックがコンテナ用に作成され、コンテナは作成元の環境のネットワークを使いません。 @@ -83,8 +83,8 @@ by KATOH Yasufumi network, the mount points, the root file system, the user namespace, and the control groups are supported. --> - 設定ファイルは,コンテナに割り当てられる様々なシステムリソースを定義します. - 現時点では,utsname,ネットワーク,マウントポイント,root ファイルシステム,ユーザ名前空間,control groups がサポートされます. + 設定ファイルは、コンテナに割り当てられる様々なシステムリソースを定義します。 + 現時点では、utsname、ネットワーク、マウントポイント、root ファイルシステム、ユーザ名前空間、control groups がサポートされます。 @@ -93,8 +93,8 @@ by KATOH Yasufumi = value fitting in one line. The '#' character means the line is a comment. --> - 設定ファイルのオプション一つを,key = value の形で一行で表します. - '#' は,その行はコメントであることを示します. + 設定ファイルのオプション一つを、key = value の形で一行で表します。 + '#' は、その行はコメントであることを示します。 @@ -108,9 +108,9 @@ by KATOH Yasufumi containers. Then, if the containers are moved to another host, only one file may need to be updated. --> - 複数の関係するコンテナの管理を容易にするために,コンテナの設定ファイルに別のファイルをロードすることが可能です. - 例えば,ネットワークの設定を,複数のコンテナから include させるように 1 つのファイルに定義することが可能です. - その場合,コンテナが他のホストに移動すると,そのファイルだけを更新する必要があるかもしれません. + 複数の関係するコンテナの管理を容易にするために、コンテナの設定ファイルに別のファイルをロードすることが可能です。 + 例えば、ネットワークの設定を、複数のコンテナから include させるように 1 つのファイルに定義することが可能です。 + その場合、コンテナが他のホストに移動すると、そのファイルだけを更新する必要があるかもしれません。 @@ -124,8 +124,8 @@ by KATOH Yasufumi Specify the file to be included. The included file must be in the same valid lxc configuration file format. --> - include させたいファイルを指定します. - include するファイルは,lxc 設定ファイルのフォーマットとして有効でなければいけません. + include させたいファイルを指定します。 + include するファイルは、lxc 設定ファイルのフォーマットとして有効でなければいけません。 @@ -142,9 +142,9 @@ by KATOH Yasufumi which rely on the architecture to do some work like downloading the packages. --> - コンテナに対してアーキテクチャを設定することが可能です. - 例えば,64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です. - この設定を行うことにより,パッケージのダウンロードを行うなどの作業のうち,アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います. + コンテナに対してアーキテクチャを設定することが可能です。 + 例えば、64 ビットのホスト上で 32 ビットのバイナリを動かすために 32 ビットアーキテクチャを設定することが可能です。 + この設定を行うことにより、パッケージのダウンロードを行うなどの作業のうち、アーキテクチャ名に依存するような作業を行うコンテナスクリプトの修正を行います。 @@ -157,7 +157,7 @@ by KATOH Yasufumi - コンテナに設定するアーキテクチャを指定します. + コンテナに設定するアーキテクチャを指定します。 - 有効なオプションは以下です. + 有効なオプションは以下です。 , , , @@ -188,9 +188,9 @@ by KATOH Yasufumi without changing the one from the system. That makes the hostname private for the container. --> - utsname セクションは,コンテナに設定されるホスト名を定義します. - コンテナは,システムのホスト名を変えることなく,自身のホスト名を持つ事が可能です. - このことにより,ホスト名はコンテナ専用となります. + utsname セクションは、コンテナに設定されるホスト名を定義します。 + コンテナは、システムのホスト名を変えることなく、自身のホスト名を持つ事が可能です。 + このことにより、ホスト名はコンテナ専用となります。 @@ -202,7 +202,7 @@ by KATOH Yasufumi - コンテナのホスト名を指定します. + コンテナのホスト名を指定します。 @@ -220,10 +220,10 @@ by KATOH Yasufumi fashion, e.g. SIGPWR, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal is SIGPWR. --> - lxc-stop がコンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定することができます. - init システムによって,クリーンなシャットダウンを行うために使うシグナルは異なります. - このオプションではシグナルとして kill(1) で使う形式を指定することができます. - 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式,もしくは数字を指定します.デフォルトのシグナルは SIGPWR です. + lxc-stop がコンテナをクリーンにシャットダウンするためにコンテナの init プロセスに送るシグナル名か番号を指定することができます。 + init システムによって、クリーンなシャットダウンを行うために使うシグナルは異なります。 + このオプションではシグナルとして kill(1) で使う形式を指定することができます。 + 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGPWR です。 @@ -251,9 +251,9 @@ by KATOH Yasufumi kill(1) fashion, e.g. SIGKILL, SIGRTMIN+14, SIGRTMAX-10 or plain number. The default signal is SIGKILL. --> - lxc-stop がコンテナを強制的にシャットダウンするために送るシグナル名か番号を指定することができます. - このオプションではシグナルとして kill(1) で使う形式を指定することができます. - 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式,もしくは数字を指定します.デフォルトのシグナルは SIGKILL です. + lxc-stop がコンテナを強制的にシャットダウンするために送るシグナル名か番号を指定することができます。 + このオプションではシグナルとして kill(1) で使う形式を指定することができます。 + 例えば SIGKILL, SIGRTMIN+14, SIGRTMAX-10 のような形式、もしくは数字を指定します。デフォルトのシグナルは SIGKILL です。 @@ -265,7 +265,7 @@ by KATOH Yasufumi - コンテナを停止するのに使用するシグナルを指定します. + コンテナを停止するのに使用するシグナルを指定します。 @@ -284,11 +284,11 @@ by KATOH Yasufumi in a container even if the system has only one physical network interface. --> - ネットワークセクションは,コンテナ内でどのようにネットワークを仮想化するかを定義します. - ネットワークの仮想化はレイヤー 2 で作動します. - ネットワークの仮想化を使用するためには,コンテナのネットワークインターフェースを定義しなければなりません. - いくつかの仮想インターフェースをアサインすることができます. - そして,仮に物理ネットワークインターフェースが一つしかなくても,コンテナ内でいくつもの仮想インターフェースを使うことができます. + ネットワークセクションは、コンテナ内でどのようにネットワークを仮想化するかを定義します。 + ネットワークの仮想化はレイヤー 2 で作動します。 + ネットワークの仮想化を使用するためには、コンテナのネットワークインターフェースを定義しなければなりません。 + いくつかの仮想インターフェースをアサインすることができます。 + そして、仮に物理ネットワークインターフェースが一つしかなくても、コンテナ内でいくつもの仮想インターフェースを使うことができます。 @@ -307,9 +307,9 @@ by KATOH Yasufumi network interfaces for one container. The different virtualization types can sbe: --> - コンテナがどの種類のネットワーク仮想化を使うかを指定します. - 一つのネットワークの設定ごとに フィールドを指定します. - このように,一つのコンテナに複数のネットワークインターフェースを割り当てることができるだけでなく,同じコンテナに対して複数のネットワーク仮想化の種類を指定することが出来ます. + コンテナがどの種類のネットワーク仮想化を使うかを指定します。 + 一つのネットワークの設定ごとに フィールドを指定します。 + このように、一つのコンテナに複数のネットワークインターフェースを割り当てることができるだけでなく、同じコンテナに対して複数のネットワーク仮想化の種類を指定することが出来ます。 仮想化の種類は以下の値を取る事が出来ます: @@ -322,9 +322,9 @@ by KATOH Yasufumi init, 'halt' in a container (for instance) will shut down the host. --> - ホストのネットワーク名前空間を共有します. - これにより,ホストのネットワークデバイスをコンテナ内で使うことが可能になります. - もしコンテナもホストも init として upstart を使っている場合,(例えば) コンテナ内で 'halt' を実行すると,ホストがシャットダウンしてしまうことにもなります. + ホストのネットワーク名前空間を共有します。 + これにより、ホストのネットワークデバイスをコンテナ内で使うことが可能になります。 + もしコンテナもホストも init として upstart を使っている場合、(例えば) コンテナ内で 'halt' を実行すると、ホストがシャットダウンしてしまうことにもなります。 @@ -332,7 +332,7 @@ by KATOH Yasufumi will create only the loopback interface. --> - ループバックインターフェースだけを作成します. + ループバックインターフェースだけを作成します。 @@ -354,12 +354,12 @@ by KATOH Yasufumi to set a specific name with the option. --> - 一方がコンテナに,もう一方が で指定されるブリッジにアタッチされる,ピアネットワークデバイスを作成します. - もし,ブリッジが指定されていない場合,veth ペアデバイスは作成されますが,ブリッジにはアタッチされません. - ブリッジはシステムで事前に設定する必要があります. - さもなければ,lxc はコンテナ外のいかなる設定も扱うことはできないでしょう. - デフォルトでは,lxc はコンテナの外部に属するネットワークデバイスに対する名前を決定し,lxc はこの名前を使います. - しかし,もしこの名前を自分で指定したい場合, オプションを使って名前を設定し,lxc に対して指定をすることができます. + 一方がコンテナに、もう一方が で指定されるブリッジにアタッチされる、ピアネットワークデバイスを作成します。 + もし、ブリッジが指定されていない場合、veth ペアデバイスは作成されますが、ブリッジにはアタッチされません。 + ブリッジはシステムで事前に設定する必要があります。 + さもなければ、lxc はコンテナ外のいかなる設定も扱うことはできないでしょう。 + デフォルトでは、lxc はコンテナの外部に属するネットワークデバイスに対する名前を決定し、lxc はこの名前を使います。 + しかし、もしこの名前を自分で指定したい場合、 オプションを使って名前を設定し、lxc に対して指定をすることができます。 @@ -370,8 +370,8 @@ by KATOH Yasufumi the container. The vlan identifier is specified with the option . --> - vlan インターフェースは で指定されたインターフェースとリンクし,コンテナに割り当てられます. - vlan の指定は オプションで指定します. + vlan インターフェースは で指定されたインターフェースとリンクし、コンテナに割り当てられます。 + vlan の指定は オプションで指定します。 @@ -403,18 +403,18 @@ by KATOH Yasufumi the MAC addresses, the macvlan bridge mode does not require learning or STP like the bridge module does. --> - macvlan インターフェースは により指定されるインターフェースとリンクし,コンテナに割り当てられます. - でモードを指定すると,その macvlan の指定を,同じ上位デバイスで異なる macvlan の間の通信をする時に使います. - 受け入れられたモードが であれば,デバイスは同じ上位デバイスの他のデバイスとの通信を行いません (デフォルト). - 新しい仮想イーサネットポート集約モード (Virtual Ethernet Port Aggregator (VEPA)) である は,隣接したポートが,ソースとデスティネーションの両方が macvlan ポートに対してローカルであるフレームを全て返すと仮定します. - すなわち,ブリッジが reflective relay として設定されているということです. - 上位デバイスから入ってくるブロードキャストフレームは,VEPA モードである全ての macvlan インターフェースに送りつけられます. - ローカルのフレームはローカルには配送されません. - の指定は,同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します. - あるインターフェースから他のインターフェースへのフレームは,直接配送され,外部には送出されません. - ブロードキャストフレームは,全ての他のブリッジと外部のインターフェースに対して送られます. - しかし,reflective relay からフレームが返ってきたときは,再度それを配送することはしません. - 全ての MAC アドレスを知っているので,ブリッジモジュールのように,macvlan ブリッジモードは学習や STP の必要はありません. + macvlan インターフェースは により指定されるインターフェースとリンクし、コンテナに割り当てられます。 + でモードを指定すると、その macvlan の指定を、同じ上位デバイスで異なる macvlan の間の通信をする時に使います。 + 受け入れられたモードが であれば、デバイスは同じ上位デバイスの他のデバイスとの通信を行いません (デフォルト)。 + 新しい仮想イーサネットポート集約モード (Virtual Ethernet Port Aggregator (VEPA)) である は、隣接したポートが、ソースとデスティネーションの両方が macvlan ポートに対してローカルであるフレームを全て返すと仮定します。 + すなわち、ブリッジが reflective relay として設定されているということです。 + 上位デバイスから入ってくるブロードキャストフレームは、VEPA モードである全ての macvlan インターフェースに送りつけられます。 + ローカルのフレームはローカルには配送されません。 + の指定は、同じポートの異なる macvlan インターフェースの間のシンプルなブリッジとして動作します。 + あるインターフェースから他のインターフェースへのフレームは、直接配送され、外部には送出されません。 + ブロードキャストフレームは、全ての他のブリッジと外部のインターフェースに対して送られます。 + しかし、reflective relay からフレームが返ってきたときは、再度それを配送することはしません。 + 全ての MAC アドレスを知っているので、ブリッジモジュールのように、macvlan ブリッジモードは学習や STP の必要はありません。 @@ -423,7 +423,7 @@ by KATOH Yasufumi specified by the is assigned to the container. --> - で指定された,すでに存在しているインターフェースがコンテナに割り当てられます. + で指定された、すでに存在しているインターフェースがコンテナに割り当てられます。 @@ -438,14 +438,14 @@ by KATOH Yasufumi specify an action to do for the network. --> - ネットワークに対して行うアクションを指定します. + ネットワークに対して行うアクションを指定します。 - インターフェースを起動させます. + インターフェースを起動させます。 @@ -460,7 +460,7 @@ by KATOH Yasufumi specify the interface to be used for real network traffic. --> - 実際のネットワークトラフィックに使うインターフェースを指定します. + 実際のネットワークトラフィックに使うインターフェースを指定します。 @@ -474,7 +474,7 @@ by KATOH Yasufumi - インターフェースに対する MTU を指定します. + インターフェースに対する MTU を指定します。 @@ -492,8 +492,8 @@ by KATOH Yasufumi eg. eth0, this option will rename the interface in the container. --> - インターフェース名は動的に割り当てられます. - しかし,もしコンテナが使用する設定ファイルが一般的な名前を使用するために,他の特定の名前が必要であれば (例えば eth0 など),コンテナ内のインターフェースは,このオプションで指定した名前にリネームされます. + インターフェース名は動的に割り当てられます。 + しかし、もしコンテナが使用する設定ファイルが一般的な名前を使用するために、他の特定の名前が必要であれば (例えば eth0 など)、コンテナ内のインターフェースは、このオプションで指定した名前にリネームされます。 @@ -512,10 +512,10 @@ by KATOH Yasufumi Any "x" in address will be replaced by random value, this allows setting hwaddr templates. --> - 仮想インターフェースの MAC アドレスは,デフォルトでは動的に割り当てられます. - しかし,MAC アドレスの衝突や,リンクローカルIPv6 アドレスを常に同じにした場合などは,このオプションが必要です. - アドレス中の "x" という文字は,ランダムな値に置き換えられます. - これによりテンプレートに hwaddr を設定することが可能になります. + 仮想インターフェースの MAC アドレスは、デフォルトでは動的に割り当てられます。 + しかし、MAC アドレスの衝突や、リンクローカルIPv6 アドレスを常に同じにした場合などは、このオプションが必要です。 + アドレス中の "x" という文字は、ランダムな値に置き換えられます。 + これによりテンプレートに hwaddr を設定することが可能になります。 @@ -534,10 +534,10 @@ by KATOH Yasufumi specified on the same line, right after the ipv4 address. --> - 仮想インターフェースに割り当てる ipv4 アドレスを指定します. - 複数行により複数の ipv4 アドレスを指定します. - このアドレスは x.y.z.t/m というフォーマットで指定します. - 例えば,192.168.1.123/24.ブロードキャストアドレスも同じ行の ipv4 アドレスのすぐ後で指定しなくてはなりません. + 仮想インターフェースに割り当てる ipv4 アドレスを指定します。 + 複数行により複数の ipv4 アドレスを指定します。 + このアドレスは x.y.z.t/m というフォーマットで指定します。 + 例えば、192.168.1.123/24。ブロードキャストアドレスも同じ行の ipv4 アドレスのすぐ後で指定しなくてはなりません。 @@ -561,13 +561,13 @@ by KATOH Yasufumi using the and network types. --> - コンテナでゲートウェイとして使う IPv4 アドレスを指定します. - アドレスは x.y.z.t というフォーマットです. - 例えば,192.168.1.123. + コンテナでゲートウェイとして使う IPv4 アドレスを指定します。 + アドレスは x.y.z.t というフォーマットです。 + 例えば、192.168.1.123。 - という特別な値を記述する事も可能です. - これは ( で指定した) ブリッジインターフェースの最初のアドレスを使用し,それをゲートウェイに使うという意味になります. - はネットワークタイプとして を指定している時だけ有効となります. + という特別な値を記述する事も可能です。 + これは ( で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。 + はネットワークタイプとして を指定している時だけ有効となります。 @@ -585,10 +585,10 @@ by KATOH Yasufumi The address is in format x::y/m, eg. 2003:db8:1:0:214:1234:fe0b:3596/64 --> - 仮想インターフェースに割り当てる ipv6 アドレスを指定します. - 複数行により複数の ipv6 アドレスを指定します. - このアドレスは x::y/m というフォーマットで指定します. - 例えば,2003:db8:1:0:214:1234:fe0b:3596/64. + 仮想インターフェースに割り当てる ipv6 アドレスを指定します。 + 複数行により複数の ipv6 アドレスを指定します。 + このアドレスは x::y/m というフォーマットで指定します。 + 例えば、2003:db8:1:0:214:1234:fe0b:3596/64。 @@ -612,12 +612,12 @@ by KATOH Yasufumi using the and network types. --> - コンテナでゲートウェイとして使う IPv6 アドレスを指定します. - アドレスは x::y というフォーマットです.例えば,2003:db8:1:0::1. + コンテナでゲートウェイとして使う IPv6 アドレスを指定します。 + アドレスは x::y というフォーマットです。例えば、2003:db8:1:0::1。 - という特別な値を記述する事も可能です. - これは ( で指定した) ブリッジインターフェースの最初のアドレスを使用し,それをゲートウェイに使うという意味になります. - はネットワークタイプとして を指定している時だけ有効となります. + という特別な値を記述する事も可能です。 + これは ( で指定した) ブリッジインターフェースの最初のアドレスを使用し、それをゲートウェイに使うという意味になります。 + はネットワークタイプとして を指定している時だけ有効となります。 @@ -640,11 +640,11 @@ by KATOH Yasufumi type, other arguments may be passed: veth/macvlan/phys. And finally (host-sided) device name. --> - ホスト側から使われる,ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します. - 以下の引数がスクリプトに渡されます: コンテナ名,設定セクション名(net). - その後の引数はスクリプトのフックで使われる設定セクションに依存します. - 以下がネットワークシステムによって使われます: 実行コンテキスト (up),ネットワークのタイプ (empty/veth/macvlan/phys) - ネットワークのタイプによっては,更に別の引数が渡されるかもしれません: veth/macvlan/phys の場合 (ホスト側の) デバイス名 + ホスト側から使われる、ネットワークの作成と設定が済んだ後に実行するスクリプトを指定します。 + 以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。 + その後の引数はスクリプトのフックで使われる設定セクションに依存します。 + 以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys) + ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys の場合 (ホスト側の) デバイス名 - スクリプトからの標準出力は debug レベルでロギングされます. - 標準エラー出力はロギングされません. - しかし,フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です. + スクリプトからの標準出力は debug レベルでロギングされます。 + 標準エラー出力はロギングされません。 + しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 @@ -677,11 +677,11 @@ by KATOH Yasufumi type, other arguments may be passed: veth/macvlan/phys. And finally (host-sided) device name. --> - ホスト側から使われる,ネットワークを破壊する前に実行するスクリプトを指定します. - 以下の引数がスクリプトに渡されます: コンテナ名,設定セクション名(net). - その後の引数はスクリプトのフックで使われる設定セクションに依存します. - 以下がネットワークシステムによって使われます: 実行コンテキスト (up),ネットワークのタイプ (empty/veth/macvlan/phys). - ネットワークのタイプによっては,更に別の引数が渡されるかもしれません: veth/macvlan/phys.そして最後に (ホスト側の) デバイス名が渡されます. + ホスト側から使われる、ネットワークを破壊する前に実行するスクリプトを指定します。 + 以下の引数がスクリプトに渡されます: コンテナ名、設定セクション名(net)。 + その後の引数はスクリプトのフックで使われる設定セクションに依存します。 + 以下がネットワークシステムによって使われます: 実行コンテキスト (up)、ネットワークのタイプ (empty/veth/macvlan/phys)。 + ネットワークのタイプによっては、更に別の引数が渡されるかもしれません: veth/macvlan/phys。そして最後に (ホスト側の) デバイス名が渡されます。 - スクリプトからの標準出力は debug レベルでロギングされます. - 標準エラー出力はロギングされません. - しかし,フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です. + スクリプトからの標準出力は debug レベルでロギングされます。 + 標準エラー出力はロギングされません。 + しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 @@ -706,7 +706,7 @@ by KATOH Yasufumi For stricter isolation the container can have its own private instance of the pseudo tty. --> - さらに厳しい隔離のために,コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です. + さらに厳しい隔離のために、コンテナは自身のプライベートな pseudo tty (擬似端末) を持つことが可能です。 @@ -721,8 +721,8 @@ by KATOH Yasufumi the maximum number of pseudo ttys allowed for a pts instance (this limitation is not implemented yet). --> - もし設定された場合,コンテナは新しい psuedo tty インスタンスを持ち,それを自身のプライベートとします. - この値は pts インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません). + もし設定された場合、コンテナは新しい psuedo tty インスタンスを持ち、それを自身のプライベートとします。 + この値は pts インスタンスに許可される pseudo tty の最大数を指定します (この制限はまだ実装されていません)。 @@ -737,7 +737,7 @@ by KATOH Yasufumi inittab file is setup to use the console, you may want to specify where the output of this console goes. --> - コンテナでルートファイルシステムを持つように設定されており,inittab ファイルでコンソールの使用が設定されている場合,このコンソールの出力がどこになされるのかを指定したいと思うでしょう. + コンテナでルートファイルシステムを持つように設定されており、inittab ファイルでコンソールの使用が設定されている場合、このコンソールの出力がどこになされるのかを指定したいと思うでしょう。 @@ -753,8 +753,8 @@ by KATOH Yasufumi console device file where the application can write, the messages will fall in the host. --> - コンソールの出力が書かれるファイルのパスを指定します.'none' というキーワードは,単純にコンソールを無効にします. - この設定は,アプリケーションが書き込む事ができるコンソールデバイスファイルが rootfs に存在する場合,メッセージがホスト側に出力されるので危険です. + コンソールの出力が書かれるファイルのパスを指定します。'none' というキーワードは、単純にコンソールを無効にします。 + この設定は、アプリケーションが書き込む事ができるコンソールデバイスファイルが rootfs に存在する場合、メッセージがホスト側に出力されるので危険です。 @@ -774,10 +774,10 @@ by KATOH Yasufumi respawn indefinitely giving annoying messages on the console or in /var/log/messages. --> - このオプションはコンテナが root ファイルシステムを持つように設定されており,inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます. - このオプションはコンテナで利用できる tty の数を指定します. - inittab ファイルに設定する getty の数は,このオプションの指定する tty の数より大きくしてはいけません. - さもなければ,超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら,永久に生死を繰り返すでしょう. + このオプションはコンテナが root ファイルシステムを持つように設定されており、inittab ファイルで tty 上に getty の起動が設定されている場合に役に立ちます。 + このオプションはコンテナで利用できる tty の数を指定します。 + inittab ファイルに設定する getty の数は、このオプションの指定する tty の数より大きくしてはいけません。 + さもなければ、超過した分の getty セッションはコンソールか /var/log/messages にうっとうしいメッセージを生死を表示しながら、永久に生死を繰り返すでしょう。 @@ -790,7 +790,7 @@ by KATOH Yasufumi Specify the number of tty to make available to the container. --> - コンテナに作成出来る tty の数を指定します. + コンテナに作成出来る tty の数を指定します。 @@ -812,13 +812,13 @@ by KATOH Yasufumi A package upgrade can then succeed as it is able to remove and replace the symbolic links. --> - LXC のコンソールはホストによって作られ,コンテナ内で要求されたデバイスに bind マウントされた Unix98 PTY 経由で提供されます. - デフォルトでは /dev/console/dev/ttyN に bind マウントされます. - これはゲスト内でのパッケージのアップグレードを妨げる可能性があります. - なので /dev 以下のディレクトリを指定することができます. - LXC はこのディレクトリ以下にファイルを作成し,これらのファイルを bind マウントします. - そして,これらの (作成された) ファイルは /dev/console/dev/ttyN にシンボリックリンクされます. - シンボリックリンクを消去したり置き換えたりすることは可能ですから,パッケージのアップグレードは成功します. + LXC のコンソールはホストによって作られ、コンテナ内で要求されたデバイスに bind マウントされた Unix98 PTY 経由で提供されます。 + デフォルトでは /dev/console/dev/ttyN に bind マウントされます。 + これはゲスト内でのパッケージのアップグレードを妨げる可能性があります。 + なので /dev 以下のディレクトリを指定することができます。 + LXC はこのディレクトリ以下にファイルを作成し、これらのファイルを bind マウントします。 + そして、これらの (作成された) ファイルは /dev/console/dev/ttyN にシンボリックリンクされます。 + シンボリックリンクを消去したり置き換えたりすることは可能ですから、パッケージのアップグレードは成功します。 @@ -831,7 +831,7 @@ by KATOH Yasufumi Specify a directory under /dev under which to create the container console devices. --> - コンテナのコンソールデバイスを作成するための /dev 以下のディレクトリを指定します. + コンテナのコンソールデバイスを作成するための /dev 以下のディレクトリを指定します。 @@ -854,12 +854,12 @@ by KATOH Yasufumi devices in the containers /dev directory may be created through the use of the hook. --> - デフォルトでは,lxc はコンテナの /dev 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが,自動的にはデバイスノードのエントリは作成しません. - これは,コンテナの rootfs で必要な設定を行えるようにするものです. - lxc.autodev が 1 に設定されている場合,コンテナの rootfs をマウントした後,LXC は新しい tmpfs を /dev 以下にマウントします (100k 制限の). - そして初期デバイスの最小限のセットを作成します. - これは,"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが,他の環境の場合はオプショナルなものです. - コンテナの /dev ディレクトリ内の追加デバイスは フックを使用して作成されます. + デフォルトでは、lxc はコンテナの /dev 以下に fd, stdin, stdout, stderr のシンボリックリンクを作成しますが、自動的にはデバイスノードのエントリは作成しません。 + これは、コンテナの rootfs で必要な設定を行えるようにするものです。 + lxc.autodev が 1 に設定されている場合、コンテナの rootfs をマウントした後、LXC は新しい tmpfs を /dev 以下にマウントします (100k 制限の)。 + そして初期デバイスの最小限のセットを作成します。 + これは、"systemd" ベースの "init" 環境のコンテナを起動する時に通常必要ですが、他の環境の場合はオプショナルなものです。 + コンテナの /dev ディレクトリ内の追加デバイスは フックを使用して作成されます。 @@ -872,7 +872,7 @@ by KATOH Yasufumi Set this to 1 to have LXC mount and populate a minimal /dev when starting the container. --> - コンテナの起動時に LXC が /dev をマウントして,最小限の /dev を作成しているようにするには,これを 1 に設定してください. + コンテナの起動時に LXC が /dev をマウントして、最小限の /dev を作成しているようにするには、これを 1 に設定してください。 @@ -885,7 +885,7 @@ by KATOH Yasufumi - /dev/kmsg の /dev/console へのシンボリックリンクとしての作成を有効にします.デフォルトは 1 です. + /dev/kmsg の /dev/console へのシンボリックリンクとしての作成を有効にします。デフォルトは 1 です。 @@ -897,7 +897,7 @@ by KATOH Yasufumi - /dev/kmsg のシンボリックリンクを無効にするには 0 を設定してください. + /dev/kmsg のシンボリックリンクを無効にするには 0 を設定してください。 @@ -914,9 +914,9 @@ by KATOH Yasufumi container. This is useful to mount /etc, /var or /home for examples. --> - マウントポイントセクションは,マウントするための区別された場所を指定します. - これらのマウントポイントは,コンテナだけに見え,コンテナ外で実行されるプロセスから見えることはありません. - 例えば,/etc や /var や /home をマウントするときに役に立つでしょう. + マウントポイントセクションは、マウントするための区別された場所を指定します。 + これらのマウントポイントは、コンテナだけに見え、コンテナ外で実行されるプロセスから見えることはありません。 + 例えば、/etc や /var や /home をマウントするときに役に立つでしょう。 @@ -928,13 +928,29 @@ by KATOH Yasufumi + マウント情報の書かれた fstab フォーマットで書かれたファイルの場所を指定します。 + マウントする場所は相対バスで書くことができます。そして、ほとんどの場合にコンテナの root からの相対パスとなるはずです。例えば、以下のように書きます。 + + +proc proc proc nodev,noexec,nosuid 0 0 + + + + この例は、root ファイルシステムがどこにあっても、コンテナの /proc 以下に proc ファイルシステムをマウントします。 + これは、ブロックデバイスがバックエンドのファイルシステムだけでなく、コンテナのクローンにも柔軟に対応できます。 + + + - マウントに関する情報が書かれた fstab フォーマットのファイルの場所を指定します. - rootfs がイメージファイルやブロックデバイスで,fstab ファイルがこの rootfs 内のどこかをマウントするために使われる場合,rootfs のマウントポイントのパスはデフォルトパスである @LXCROOTFSMOUNT@ か,もしくは が指定されている場合は,その値を前に付ける必要があります. - ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合,3 つ目のフィールド (fs_vfstype) は + ファイルシステムがイメージファイルやブロックデバイスからマウントされている場合、3 つ目のフィールド (fs_vfstype) は mount 8 - のように auto を指定することはできず,明確に指定しなければいけません. + のように auto を指定することはできず、明確に指定しなければいけません。 @@ -965,7 +979,7 @@ by KATOH Yasufumi specify a mount point corresponding to a line in the fstab format. --> - fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします. + fstab フォーマットの一行と同じフォーマットのマウントポイントの指定をします。 @@ -981,8 +995,8 @@ by KATOH Yasufumi automatically mounted. This may dramatically simplify the configuration. The file systems are: --> - 標準のカーネルファイルシステムで自動的にマウントするものを指定します. - これは劇的に設定を容易にする可能性があります. + 標準のカーネルファイルシステムで自動的にマウントするものを指定します。 + これは劇的に設定を容易にする可能性があります。 @@ -997,8 +1011,8 @@ by KATOH Yasufumi --> (or ): - /proc を読み書き可能でマウントします. - ただし,/proc/sys/proc/sysrq-trigger は,セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます. + /proc を読み書き可能でマウントします。 + ただし、/proc/sys/proc/sysrq-trigger は、セキュリティとコンテナの隔離の目的でリードオンリーで再マウントされます。 @@ -1010,7 +1024,7 @@ by KATOH Yasufumi --> : - /proc を読み書き可能でマウントします. + /proc を読み書き可能でマウントします。 @@ -1023,7 +1037,7 @@ by KATOH Yasufumi --> (or ): - /sys を,セキュリティとコンテナの隔離の目的でリードオンリーでマウントします. + /sys を、セキュリティとコンテナの隔離の目的でリードオンリーでマウントします。 @@ -1035,14 +1049,13 @@ by KATOH Yasufumi --> : - /sys を読み書き可能でマウントします. + /sys を読み書き可能でマウントします。 - (or ): - /sys/fs/cgroup を tmpfs でマウントし,そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し,その cgroup の名前でその中にサブディレクトリを作製し,そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします. - コンテナは自身の cgroup ディレクトリに書き込みが可能ですが,親ディレクトリはリードオンリーで再マウントされているため書き込めません. + : + /sys/fs/cgroup を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、その cgroup の名前でその中にサブディレクトリを作製し、そのコンテナ自身の cgroup をそのディレクトリにバインドマウントします。 + コンテナは自身の cgroup ディレクトリに書き込みが可能ですが、親ディレクトリはリードオンリーで再マウントされているため書き込めません。 @@ -1069,7 +1082,7 @@ by KATOH Yasufumi --> : - と同様にマウントされますが,全てリードオンリーでマウントされます. + と同様にマウントされますが、全てリードオンリーでマウントされます。 @@ -1085,16 +1098,27 @@ by KATOH Yasufumi --> : - と同様にマウントされますが,全て読み書き可能でマウントされます. - コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが,cgroup ファイルシステムにはならず, - /sys/fs/cgroup の tmpfs の一部分になるでしょう. + と同様にマウントされますが、全て読み書き可能でマウントされます。 + コンテナ自身の cgroup に至るまでのパスも書き込み可能になることに注意が必要ですが、cgroup ファイルシステムにはならず、 + /sys/fs/cgroup の tmpfs の一部分になるでしょう。 + + + + (マウントオプションなしの場合): + コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、 となります。保持していない場合、 となります。 + + - (or ): - /sys/fs/cgroup を tmpfs でマウントし,そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し,ホストからコンテナまでの階層構造を全てバインドマウントし,コンテナ自身の cgroup を除いてリードオンリーにします. - と比べると,コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり,コンテナ自身の cgroup の外ではリードオンリーになりますが,/sys/fs/cgroup/$hierarchy はホストの全ての cgroup 階層構造を含みます. - これにより,コンテナにはかなりの情報が漏洩します. + : + /sys/fs/cgroup を tmpfs でマウントし、そのコンテナの追加が行われた全ての階層構造に対するディレクトリを作製し、ホストからコンテナまでの階層構造を全てバインドマウントし、コンテナ自身の cgroup を除いてリードオンリーにします。 + と比べると、コンテナ自身の cgroup に至るまでの全てのパスが tmpfs の下層のシンプルなディレクトリとなり、コンテナ自身の cgroup の外ではリードオンリーになりますが、/sys/fs/cgroup/$hierarchy はホストの全ての cgroup 階層構造を含みます。 + これにより、コンテナにはかなりの情報が漏洩します。 @@ -1128,7 +1152,7 @@ by KATOH Yasufumi --> : - と同様にマウントされますが,全てリードオンリーでマウントされます. + と同様にマウントされますが、全てリードオンリーでマウントされます。 @@ -1145,11 +1169,51 @@ by KATOH Yasufumi --> : - と同様にマウントされますが,全て読み書き可能でマウントされます. - この場合,コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち,自身で cgroup ファイルシステムをマウント可能なら,いずれにせよそのようにするかもしれないことにも注意してください). + と同様にマウントされますが、全て読み書き可能でマウントされます。 + この場合、コンテナは自身の cgroup から脱出する可能性があることに注意してください (コンテナが CAP_SYS_ADMIN を持ち、自身で cgroup ファイルシステムをマウント可能なら、いずれにせよそのようにするかもしれないことにも注意してください)。 + + + + (マウントオプションなしの場合): + コンテナが CAP_SYS_ADMIN ケーパビリティを保持している場合、 となります。保持していない場合、 となります。 + + + + + cgroup ファイルシステムの自動マウントが有効の場合、/sys/fs/cgroup 以下の tmpfs は常に読み書き可能でマウントされることに注意が必要です (しかし の場合は、個々の階層の /sys/fs/cgroup/$hierarchy は読み込み専用となるでしょう)。これは Ubuntu の + + mountall + 8 + + コマンドの特異な動きに対処するためのものです。特異な動きとは、/sys/fs/cgroup が読み込み専用でマウントされた状態で、コンテナが CAP_SYS_ADMIN を持たない場合、/sys/fs/cgroup を読み書き可能で再マウントしようとしてできないため、コンテナのブート時にユーザからの入力を待ってしまうというものです。 + - コンテナのルートファイルシステムは,ホストのルートファイルシステムと異なるようにすることも可能です. + コンテナのルートファイルシステムは、ホストのルートファイルシステムと異なるようにすることも可能です。 @@ -1188,9 +1252,9 @@ by KATOH Yasufumi specified, the container shares its root file system with the host. --> - コンテナのルートファイルシステムになるディレクトリを指定します. - この値はイメージファイル,ディレクトリ,ブロックデバイスのどれかを取ることができます. - もし指定されない場合,コンテナはホストとルートファイルシステムを共有します. + コンテナのルートファイルシステムになるディレクトリを指定します。 + この値はイメージファイル、ディレクトリ、ブロックデバイスのどれかを取ることができます。 + もし指定されない場合、コンテナはホストとルートファイルシステムを共有します。 @@ -1211,13 +1275,13 @@ by KATOH Yasufumi syscall. Any directory suffices, the default should generally work. --> - root ファイルシステムの変更の前に, を再帰的にどこにバインドするのかを指定します.これは + root ファイルシステムの変更の前に、 を再帰的にどこにバインドするのかを指定します。これは pivot_root 8 - システムコールが確実に成功する事を保証します. - どんなディレクトリでも良く,デフォルトでも通常は動くはずです. + システムコールが確実に成功する事を保証します。 + どんなディレクトリでも良く、デフォルトでも通常は動くはずです。 @@ -1231,7 +1295,7 @@ by KATOH Yasufumi - rootfs をマウントするときに追加したいマウントオプション. + rootfs をマウントするときに追加したいマウントオプション。 @@ -1249,9 +1313,9 @@ by KATOH Yasufumi It is created if necessary, and also removed after unmounting everything from it during container setup. --> - 元の root ファイルシステムを, 以下のどこに移動させるかを からの相対パスで指定します. - デフォルトは mnt です. - これはもし必要であれば作成され,そしてコンテナのセットアップの間,全てアンマウントされた後で消去されます. + 元の root ファイルシステムを、 以下のどこに移動させるかを からの相対パスで指定します。 + デフォルトは mnt です。 + これはもし必要であれば作成され、そしてコンテナのセットアップの間、全てアンマウントされた後で消去されます。 @@ -1269,9 +1333,9 @@ by KATOH Yasufumi started, but has the advantage of permitting any future subsystem. --> - CONTROL GROUP セクションは,(lxc とは) 別のサブシステムの設定を含みます. - lxc は,このサブシステム名の正しさはチェックしません. - 実行時のエラーを検出するのに不便ですが,別の将来のサブシステムをサポート出来るという有利な点もあります. + CONTROL GROUP セクションは、(lxc とは) 別のサブシステムの設定を含みます。 + lxc は、このサブシステム名の正しさはチェックしません。 + 実行時のエラーを検出するのに不便ですが、別の将来のサブシステムをサポート出来るという有利な点もあります。 @@ -1289,9 +1353,9 @@ by KATOH Yasufumi container is started, eg. --> - 設定する control group の値を指定します. - サブシステム名は,control group のそのままの名前です. - 許される名前や値の書式は LXC が指示することはなく,コンテナが実行された時に実行されている Linux カーネルの機能に依存します. + 設定する control group の値を指定します。 + サブシステム名は、control group のそのままの名前です。 + 許される名前や値の書式は LXC が指示することはなく、コンテナが実行された時に実行されている Linux カーネルの機能に依存します。 例えば @@ -1306,7 +1370,7 @@ by KATOH Yasufumi The capabilities can be dropped in the container if this one is run as root. --> - コンテナが root 権限で実行されていても,コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です. + コンテナが root 権限で実行されていても、コンテナ内ではケーパビリティ (capabilities) を削除する事は可能です。 @@ -1327,11 +1391,11 @@ by KATOH Yasufumi 7 , --> - コンテナ内で削除するケーパビリティ (capability) を指定します. - 一行でスペース区切りで複数のケーパビリティを指定することも可能です. - 指定は,"CAP_" というプレフィックスなしで,小文字でケーパビリティを指定します. - 例えば,CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります. - 詳しくは以下を参照してください. + コンテナ内で削除するケーパビリティ (capability) を指定します。 + 一行でスペース区切りで複数のケーパビリティを指定することも可能です。 + 指定は、"CAP_" というプレフィックスなしで、小文字でケーパビリティを指定します。 + 例えば、CAP_SYS_MODULE というケーパビリティは sys_module と指定する必要があります。 + 詳しくは以下を参照してください。 capabilities 7 @@ -1349,8 +1413,8 @@ by KATOH Yasufumi Specify the capability to be kept in the container. All other capabilities will be dropped. --> - コンテナ内で維持するケーパビリティを指定します. - 指定した以外の全てのケーパビリティはドロップされます. + コンテナ内で維持するケーパビリティを指定します。 + 指定した以外の全てのケーパビリティはドロップされます。 @@ -1366,8 +1430,8 @@ by KATOH Yasufumi container should be run can be specified in the container configuration. The default is lxc-container-default. --> - lxc が apparmor サポートでコンパイルされ,インストールされている場合で,ホストで apparmor が有効な場合,コンテナが従って動くべき apparmor プロファイルは,コンテナの設定で指定することが可能です. - デフォルトは lxc-container-default です. + lxc が apparmor サポートでコンパイルされ、インストールされている場合で、ホストで apparmor が有効な場合、コンテナが従って動くべき apparmor プロファイルは、コンテナの設定で指定することが可能です。 + デフォルトは lxc-container-default です。 @@ -1381,8 +1445,8 @@ by KATOH Yasufumi be run. To specify that the container should be unconfined, use --> - コンテナが従うべき apparmor プロファイルを指定します. - コンテナが apparmor による制限を受けないように設定するには,以下のように設定します. + コンテナが従うべき apparmor プロファイルを指定します。 + コンテナが apparmor による制限を受けないように設定するには、以下のように設定します。 lxc.aa_profile = unconfined @@ -1400,8 +1464,8 @@ by KATOH Yasufumi configuration. The default is unconfined_t, which means that lxc will not attempt to change contexts. --> - lxc が SELinux サポートでコンパイルされ,インストールされている場合で,ホストで SELinux が有効な場合,コンテナが従って動くべき SELinux コンテキストは,コンテナの設定で指定することが可能です. - デフォルトは unconfined_t であり,これは lxc がコンテキストを変えないという意味になります. + lxc が SELinux サポートでコンパイルされ、インストールされている場合で、ホストで SELinux が有効な場合、コンテナが従って動くべき SELinux コンテキストは、コンテナの設定で指定することが可能です。 + デフォルトは unconfined_t であり、これは lxc がコンテキストを変えないという意味になります。 @@ -1414,7 +1478,7 @@ by KATOH Yasufumi Specify the SELinux context under which the container should be run or unconfined_t. For example --> - コンテナが従うべき SELinux コンテキストを指定するか,unconfined_t を指定します.例えば以下のように設定します. + コンテナが従うべき SELinux コンテキストを指定するか、unconfined_t を指定します。例えば以下のように設定します。 lxc.se_context = unconfined_u:unconfined_r:lxc_t:s0-s0:c0.c1023 @@ -1432,8 +1496,8 @@ by KATOH Yasufumi on the first line, a policy type on the second line, followed by the configuration. --> - コンテナは,起動時に seccomp プロファイルをロードすることで,利用可能なシステムコールを減らして起動することが可能です. - seccomp の設定ファイルは,1 行目がバージョン番号,2 行目がポリシーのタイプで始まる必要があり,その後に設定を書きます. + コンテナは、起動時に seccomp プロファイルをロードすることで、利用可能なシステムコールを減らして起動することが可能です。 + seccomp の設定ファイルは、1 行目がバージョン番号、2 行目がポリシーのタイプで始まる必要があり、その後に設定を書きます。 - 現時点では,バージョン番号は 1 と 2 をサポートしています.バージョン 1 では,ポリシーはシンプルなホワイトリストですので,2 行目は "whitelist" でなければなりません. - そして残りの行には 1 行に 1 つずつ,システムコール番号を書きます.各行のシステムコール番号がホワイトリスト化され,リストにない番号は,そのコンテナではブラックリストに入ります. + 現時点では、バージョン番号は 1 と 2 をサポートしています。バージョン 1 では、ポリシーはシンプルなホワイトリストですので、2 行目は "whitelist" でなければなりません。 + そして残りの行には 1 行に 1 つずつ、システムコール番号を書きます。各行のシステムコール番号がホワイトリスト化され、リストにない番号は、そのコンテナではブラックリストに入ります。 @@ -1453,7 +1517,7 @@ by KATOH Yasufumi supports per-rule and per-policy default actions, and supports per-architecture system call resolution from textual names. --> - バージョン 2 では,ポリシーはブラックリストもしくはホワイトリストで表され,ルールごとのアクションと,ポリシーごとのデフォルトのアクションを設定できます.そして,アーキテクチャごとの設定と,テキストで書かれたシステムコール名での設定が可能です. + バージョン 2 では、ポリシーはブラックリストもしくはホワイトリストで表され、ルールごとのアクションと、ポリシーごとのデフォルトのアクションを設定できます。そして、アーキテクチャごとの設定と、テキストで書かれたシステムコール名での設定が可能です。 - 以下にブラックリストのポリシーの例を示します.これは mknod 以外の全てのシステムコールが許可され,mknod が呼ばれると,何もせずに単に 0(成功) を返します. + 以下にブラックリストのポリシーの例を示します。これは mknod 以外の全てのシステムコールが許可され、mknod が呼ばれると、何もせずに単に 0(成功) を返します。 2 @@ -1479,7 +1543,7 @@ mknod errno 0 Specify a file containing the seccomp configuration to load before the container starts. --> - コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します. + コンテナがスタートする前にロードする seccomp の設定を含むファイルを指定します。 @@ -1499,11 +1563,11 @@ mknod errno 0 user and group ids 0 through 20,000 in the container to the ids 200,000 through 220,000. --> - コンテナは,ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です. - たとえば,コンテナ内のユーザ id 0 を,ホストのユーザ id 200000 にマッピングすることが可能です. - コンテナの root ユーザはコンテナ内では特権を持ちますが,ホストでは特権を持ちません. - 通常は,システムコンテナは id の範囲を要求し,それをマッピングします. - 例えば,コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします. + コンテナは、ユーザとグループの id のマッピングを持った専用のユーザ名前空間で起動することが可能です。 + たとえば、コンテナ内のユーザ id 0 を、ホストのユーザ id 200000 にマッピングすることが可能です。 + コンテナの root ユーザはコンテナ内では特権を持ちますが、ホストでは特権を持ちません。 + 通常は、システムコンテナは id の範囲を要求し、それをマッピングします。 + 例えば、コンテナ内のユーザとグループの id 0 から 20,000 を 200,000 から 220,000 にマッピングします。 @@ -1520,11 +1584,11 @@ mknod errno 0 seen on the host. Finally, a range indicating the number of consecutive ids to map. --> - 4 つの値を記述する必要があります. - 最初の文字は 'u' か 'g' のどちらかで,ユーザかグループの ID のどちらをマッピングするかを指定します. - 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です. - その次は,そのユーザ ID のホスト上での値です. - 最後は,ID のマッピングをいくつ連続して行うかの数を指定します. + 4 つの値を記述する必要があります。 + 最初の文字は 'u' か 'g' のどちらかで、ユーザかグループの ID のどちらをマッピングするかを指定します。 + 次はコンテナのユーザ名前空間内に現れる最初のユーザ ID です。 + その次は、そのユーザ ID のホスト上での値です。 + 最後は、ID のマッピングをいくつ連続して行うかの数を指定します。 @@ -1538,7 +1602,7 @@ mknod errno 0 Container hooks are programs or scripts which can be executed at various times in a container's lifetime. --> - コンテナのフックは,コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです. + コンテナのフックは、コンテナの存続期間の色々な場面で実行することのできるプログラムやスクリプトです。 - コンテナのフックが実行されるとき,情報がコマンドライン引数と環境変数の両方を通して渡されます.引数は: + コンテナのフックが実行されるとき、情報がコマンドライン引数と環境変数の両方を通して渡されます。引数は: コンテナ名 セクション (常に 'lxc') フックのタイプ ('clone' や 'pre-mount' など) - 追加の引数.clone フックの場合,lxc-clone に渡される追加の引数は,フックへの引数として追加されます. + 追加の引数。clone フックの場合、lxc-clone に渡される追加の引数は、フックへの引数として追加されます。 - 以下の環境変数がセットされます. + 以下の環境変数がセットされます。 LXC_NAME: コンテナ名 LXC_ROOTFS_MOUNT: マウントされた root ファイルシステムへのパス LXC_CONFIG_FILE: コンテナの設定ファイルのパス - LXC_SRC_NAME: clone フックの場合,元のコンテナの名前 - LXC_ROOTFS_PATH: コンテナの lxc.rootfs エントリ.これはマウントされた rootfs が存在する場所にはならないでしょう.それには LXC_ROOTFS_MOUNT を使用してください. + LXC_SRC_NAME: clone フックの場合、元のコンテナの名前 + LXC_ROOTFS_PATH: コンテナの lxc.rootfs エントリ。これはマウントされた rootfs が存在する場所にはならないでしょう。それには LXC_ROOTFS_MOUNT を使用してください。 @@ -1584,9 +1648,9 @@ mknod errno 0 Standard error is not logged, but can be captured by the hook redirecting its standard error to standard output. --> - スクリプトからの標準出力は debug レベルでロギングされます. - 標準エラー出力はロギングされません. - しかし,フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です. + スクリプトからの標準出力は debug レベルでロギングされます。 + 標準エラー出力はロギングされません。 + しかし、フックの標準エラー出力を標準出力にリダイレクトすることにより保存することは可能です。 @@ -1599,7 +1663,7 @@ mknod errno 0 A hook to be run in the host's namespace before the container ttys, consoles, or mounts are up. --> - コンテナの tty,コンソールの作成,マウントが実行される前に,ホストの名前空間内で実行するフック. + コンテナの tty、コンソールの作成、マウントが実行される前に、ホストの名前空間内で実行するフック。 @@ -1619,11 +1683,11 @@ mknod errno 0 mounts propagation), so they will be automatically cleaned up when the container shuts down. --> - コンテナのファイルシステムの名前空間で実行されますが,rootfs が設定される前に実行するフック. - これにより rootfs の操作が可能になります. - 例えば,暗号化されたファイルシステムのマウントなどです. - このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて). - なので,それらはコンテナがシャットダウンする時に自動的にクリーンアップされます. + コンテナのファイルシステムの名前空間で実行されますが、rootfs が設定される前に実行するフック。 + これにより rootfs の操作が可能になります。 + 例えば、暗号化されたファイルシステムのマウントなどです。 + このフック内でなされるマウントはホストには影響しません (mounts propagation を除いて)。 + なので、それらはコンテナがシャットダウンする時に自動的にクリーンアップされます。 @@ -1639,7 +1703,7 @@ mknod errno 0 A hook to be run in the container's namespace after mounting has been done, but before the pivot_root. --> - マウントが完了した後ですが,pivot_root の前にコンテナの名前空間で実行されるフック. + マウントが完了した後ですが、pivot_root の前にコンテナの名前空間で実行されるフック。 @@ -1663,8 +1727,8 @@ mknod errno 0 ${} environment variable available when the hook is run. --> - == 1 が設定されている場合で,マウントが完了し,マウント時のフックも実行された後ですが,pivot_root の前にコンテナの名前空間で実行するフック. - このフックの目的は,systemd ベースのコンテナ向けの autodev オプションが設定されている時に,コンテナの /dev ディレクトリを設定するのを支援することです.コンテナの /dev ディレクトリは,このフックが実行される時有効な ${} 環境変数からの相対パスとなります. + == 1 が設定されている場合で、マウントが完了し、マウント時のフックも実行された後ですが、pivot_root の前にコンテナの名前空間で実行するフック。 + このフックの目的は、systemd ベースのコンテナ向けの autodev オプションが設定されている時に、コンテナの /dev ディレクトリを設定するのを支援することです。コンテナの /dev ディレクトリは、このフックが実行される時有効な ${} 環境変数からの相対パスとなります。 @@ -1681,8 +1745,8 @@ mknod errno 0 before executing the container's init. This requires the program to be available in the container. --> - コンテナの init が実行される直前にコンテナの名前空間で実行されるフック. - コンテナ内で利用可能なプログラムである必要があります. + コンテナの init が実行される直前にコンテナの名前空間で実行されるフック。 + コンテナ内で利用可能なプログラムである必要があります。 @@ -1698,7 +1762,7 @@ mknod errno 0 A hook to be run in the host's namespace after the container has been shut down. --> - コンテナがシャットダウンされた後にホストの名前空間で実行するフック. + コンテナがシャットダウンされた後にホストの名前空間で実行するフック。 @@ -1715,10 +1779,10 @@ mknod errno 0 See lxc-clone 1 for more information. --> - コンテナが新しいコンテナにクローンされる際に実行されるフック.詳しくは + コンテナが新しいコンテナにクローンされる際に実行されるフック。詳しくは lxc-clone 1 - を参照してください. + を参照してください。 @@ -1735,9 +1799,9 @@ mknod errno 0 contexts. In particular, all paths are relative to the host system and, as such, not valid during the hook. --> - 起動時のフックに設定情報を提供し,フックの機能を助けるための環境変数がいくつか利用可能です. - 全ての変数が全てのコンテキストで利用可能なわけではありません. - 具体的には,全てのパスはホストシステム上のパスであり,そのため, フックの時点では使用できません. + 起動時のフックに設定情報を提供し、フックの機能を助けるための環境変数がいくつか利用可能です。 + 全ての変数が全てのコンテキストで利用可能なわけではありません。 + 具体的には、全てのパスはホストシステム上のパスであり、そのため、 フックの時点では使用できません。 @@ -1750,7 +1814,7 @@ mknod errno 0 The LXC name of the container. Useful for logging messages in common log environments. [] --> - LXC コンテナの名前.共通のログ環境内でのログメッセージに使うときに便利です.[] + LXC コンテナの名前。共通のログ環境内でのログメッセージに使うときに便利です。[] @@ -1769,8 +1833,8 @@ mknod errno 0 additional configuration information not otherwise made available. [] --> - コンテナの設定ファイルのホスト上でのパス. - これは,他の方法では得られない追加の設定情報を見つけるために,コンテナに,元の,トップレベルの設定ファイルの位置を与えるものです. [] + コンテナの設定ファイルのホスト上でのパス。 + これは、他の方法では得られない追加の設定情報を見つけるために、コンテナに、元の、トップレベルの設定ファイルの位置を与えるものです。 [] @@ -1786,7 +1850,7 @@ mknod errno 0 The path to the console output of the container if not NULL. [] [] --> - 設定されている場合のコンテナのコンソール出力のパス. + 設定されている場合のコンテナのコンソール出力のパス。 [] [] @@ -1803,7 +1867,7 @@ mknod errno 0 The path to the console log output of the container if not NULL. [] --> - 設定されている場合のコンテナのコンソールログ出力のパス. + 設定されている場合のコンテナのコンソールログ出力のパス。 [] @@ -1823,8 +1887,8 @@ mknod errno 0 should be made for that instance. [] --> - 初期にコンテナがマウントされる場所. - これは,コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり,インスタンスのための移行が行われる場所です. + 初期にコンテナがマウントされる場所。 + これは、コンテナインスタンスが起動するためのコンテナの rootfs へのホスト上のパスであり、インスタンスのための移行が行われる場所です。 [] @@ -1842,7 +1906,7 @@ mknod errno 0 mounted to the rootfs.mount location. [] --> - rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです. + rootfs.mount へマウントされるコンテナのルートへのホスト上のパスです。 @@ -1860,8 +1924,8 @@ mknod errno 0 the container (with '.log' appended) either under the container path, or under @LOGPATH@. --> - ロギングはコンテナごとに設定することが可能です. - デフォルトでは,lxc パッケージのコンパイル条件に依存し,コンテナのスタートアップは ERROR レベルでのみロギングされ,コンテナのパス以下か,@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます. + ロギングはコンテナごとに設定することが可能です。 + デフォルトでは、lxc パッケージのコンパイル条件に依存し、コンテナのスタートアップは ERROR レベルでのみロギングされ、コンテナのパス以下か、@LOGPATH@ 以下のどちらかにコンテナ名 (の後に '.log' が付与される) をもとにした名前でロギングされます。 - デフォルトのログレベルとログファイルは両方とも,コンテナの設定ファイル内で指定され,デフォルトの値を上書きします. - 同様に,設定ファイルのエントリは lxc-start のコマンドラインオプションで上書きすることも可能です. + デフォルトのログレベルとログファイルは両方とも、コンテナの設定ファイル内で指定され、デフォルトの値を上書きします。 + 同様に、設定ファイルのエントリは lxc-start のコマンドラインオプションで上書きすることも可能です。 @@ -1888,11 +1952,11 @@ mknod errno 0 alert, and 8 = fatal. If unspecified, the level defaults to 5 (error), so that only errors and above are logged. --> - ログを取得するレベル. - ログレベルは 0..8 の範囲の整数です. - 数字が小さいほど冗長なデバッグを意味します. - 具体的には,0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です. - 指定されない場合,レベルのデフォルトは 5 (error) で,それ以上のエラーがロギングされます. + ログを取得するレベル。 + ログレベルは 0..8 の範囲の整数です。 + 数字が小さいほど冗長なデバッグを意味します。 + 具体的には、0 = trace, 1 = debug, 2 = info, 3 = notice, 4 = warn, 5 = error, 6 = critical, 7 = alert, and 8 = fatal です。 + 指定されない場合、レベルのデフォルトは 5 (error) で、それ以上のエラーがロギングされます。 - (フックスクリプトやネットワークインターフェースの起動,停止時のスクリプトのような) スクリプトが呼ばれた時,スクリプトの標準出力は level 1 の debug でロギングされます. + (フックスクリプトやネットワークインターフェースの起動、停止時のスクリプトのような) スクリプトが呼ばれた時、スクリプトの標準出力は level 1 の debug でロギングされます。 @@ -1913,7 +1977,7 @@ mknod errno 0 - ログ情報を書き込むファイル. + ログ情報を書き込むファイル。 @@ -1928,8 +1992,8 @@ mknod errno 0 auto-started and in what order. These options may be used by LXC tools directly or by external tooling provided by the distributions. --> - 自動起動オプションでは,自動起動させるコンテナと順番の設定が可能です. - このオプションは LXC ツールが直接使用するか,ディストリビューションが提供する外部ツールが使用するかもしれません. + 自動起動オプションでは、自動起動させるコンテナと順番の設定が可能です。 + このオプションは LXC ツールが直接使用するか、ディストリビューションが提供する外部ツールが使用するかもしれません。 @@ -1943,8 +2007,8 @@ mknod errno 0 Whether the container should be auto-started. Valid values are 0 (off) and 1 (on). --> - コンテナを自動起動させるかどうかを設定します. - 有効な値は 0(オフ) か 1(オン) です. + コンテナを自動起動させるかどうかを設定します。 + 有効な値は 0(オフ) か 1(オン) です。 @@ -1958,7 +2022,7 @@ mknod errno 0 How long to wait (in seconds) after the container is started before starting the next one. --> - コンテナを起動させた後,次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します. + コンテナを起動させた後、次のコンテナを起動させるまでにどれくらい (秒) 待つかを設定します。 @@ -1972,7 +2036,7 @@ mknod errno 0 An integer used to sort the containers when auto-starting a series of containers at once. --> - 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します. + 多数の自動起動させるコンテナがある場合のコンテナの起動順を決めるのに使う整数を指定します。 @@ -1988,15 +2052,45 @@ mknod errno 0 used (amongst other things) to start a series of related containers. --> - コンテナを追加したいコンテナグループ名を指定します. - (複数回使用される可能性のある) 複数の値を設定可能です. - 設定されたグループは,関連する一連のコンテナを起動させるために使われます. + コンテナを追加したいコンテナグループ名を指定します。 + (複数回使用される可能性のある) 複数の値を設定可能です。 + 設定されたグループは、関連する一連のコンテナを起動させるために使われます。 + + <!-- Autostart and System Boot -->自動起動とシステムブート + + + コンテナはいくつでもグループに属することができ、全く属さないことも可能です。特別なグループが 2 つ存在します。1 つは NULL グループです。これはどのグループにも属さないコンテナです。もう 1 つは "onboot" グループです。 + + + + + LXC サービスが有効になった状態でシステムがブートすると、最初に "onboot" グループのメンバーである lxc.start.auto == 1 が設定されたコンテナを起動しようとします。起動は lxc.start.order の順に起動します。 + lxc.start.delay が指定されている場合、現在対象となっているコンテナに初期化の時間を与え、ホストシステムの負荷を低減するために、次のコンテナを開始させるまでに遅延時間を与えます。 + "onboot" グループのメンバーが開始した後、LXC システムは lxc.start.auto == 1 が設定された、どのグループのメンバーでもない (NULL グループの) コンテナのブートを onboot グループのコンテナと同様に開始します。 + + + @@ -2006,7 +2100,7 @@ mknod errno 0 In addition to the few examples given below, you will find some other examples of configuration file in @DOCDIR@/examples --> - 以下に紹介するいくつかの例に加えて,他の設定例が @DOCDIR@/examples にあります. + 以下に紹介するいくつかの例に加えて、他の設定例が @DOCDIR@/examples にあります。 <!-- Network -->ネットワーク @@ -2018,8 +2112,8 @@ mknod errno 0 virtual network device visible in the container is renamed to eth0. --> - この設定は,片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります). - 仮想ネットワークデバイスは,コンテナ内では eth0 とリネームされます. + この設定は、片方をブリッジである br0 と接続される veth ペアデバイスを使うコンテナを設定します (ブリッジは管理者によりあらかじめシステム上に設定済みである必要があります)。 + 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。 lxc.utsname = myhostname @@ -2037,7 +2131,7 @@ mknod errno 0 <!-- UID/GID mapping -->UID/GID のマッピング - この設定は,コンテナ内のユーザとグループ両方の id 0-9999 の範囲を,ホスト上の 100000-109999 へマッピングします. + この設定は、コンテナ内のユーザとグループ両方の id 0-9999 の範囲を、ホスト上の 100000-109999 へマッピングします。 lxc.id_map = u 0 100000 10000 @@ -2052,10 +2146,10 @@ mknod errno 0 the application, cpuset.cpus restricts usage of the defined cpu, cpus.share prioritize the control group, devices.allow makes usable the specified devices.--> - この設定は,アプリケーションのための control group をいくつか設定します. - cpuset.cpus は定義された cpu のみ使用できるように制限します. - cpus.share は,control group の (cpu) 優先度を指定します. - devices.allow は,特定のデバイスを使用可能にします. + この設定は、アプリケーションのための control group をいくつか設定します。 + cpuset.cpus は定義された cpu のみ使用できるように制限します。 + cpus.share は、control group の (cpu) 優先度を指定します。 + devices.allow は、特定のデバイスを使用可能にします。 lxc.cgroup.cpuset.cpus = 0,1 @@ -2072,7 +2166,7 @@ mknod errno 0 - この例は,control group を使って,複雑なネットワークスタックを作成し,新しいホスト名を指定し,いくつかの場所をマウントし,ルートファイルシステムを変更するような複雑な設定を示します. + この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。 lxc.utsname = complex diff --git a/doc/ja/lxc.sgml.in b/doc/ja/lxc.sgml.in index 0258bfa198..2ff4ee425e 100644 --- a/doc/ja/lxc.sgml.in +++ b/doc/ja/lxc.sgml.in @@ -68,8 +68,8 @@ by KATOH Yasufumi @BINDIR@/lxc-execute -n foo -f @DOCDIR@/examples/lxc-macvlan.conf /bin/bash --> - 急いでいて,この man ページすら読みたくないという場合は,いいでしょう, - 保証はないですが,あらかじめ準備されている設定テンプレートを使ったコンテナ内でシェルを動かすためのコマンドを紹介しましょう. + 急いでいて、この man ページすら読みたくないという場合は、いいでしょう、 + 保証はないですが、あらかじめ準備されている設定テンプレートを使ったコンテナ内でシェルを動かすためのコマンドを紹介しましょう。 @BINDIR@/lxc-execute -n foo -f @DOCDIR@/examples/lxc-macvlan.conf /bin/bash @@ -84,8 +84,8 @@ by KATOH Yasufumi through the control groups aka process containers and resource isolation through the namespaces. --> - コンテナ技術は,メインストリームの linux kernel で活発に開発が進んでいる技術です. - コンテナ技術は,process container という名前でも知られる control groups の機能を使って,リソース管理を提供し,名前空間を使って,リソースの隔離を提供します. + コンテナ技術は、メインストリームの linux kernel で活発に開発が進んでいる技術です。 + コンテナ技術は、process container という名前でも知られる control groups の機能を使って、リソース管理を提供し、名前空間を使って、リソースの隔離を提供します。 @@ -95,8 +95,8 @@ by KATOH Yasufumi which provides full resource isolation and resource control for an applications or a system. --> - linux コンテナ (lxc) は,ユーザースペースのコンテナオブジェクトを提供するための新しい機能を使う事を目指しています. - この新しい機能とは,アプリケーションやシステムでの利用を目的とした,完全なリソースの隔離やリソースコントロールを提供する機能です. + linux コンテナ (lxc) は、ユーザースペースのコンテナオブジェクトを提供するための新しい機能を使う事を目指しています。 + この新しい機能とは、アプリケーションやシステムでの利用を目的とした、完全なリソースの隔離やリソースコントロールを提供する機能です。 @@ -108,8 +108,8 @@ by KATOH Yasufumi manage a container with simple command lines and complete enough to be used for other purposes. --> - このプロジェクトの第一の目的は,コンテナプロジェクトに参加するカーネル開発者の作業を快適にすることと,特に新機能である Checkpoint/Restart 機能への取り組みを続ける事です. - lxc コマンドは,シンプルなコマンドでコンテナの管理を簡単に行えるように小さく,他の目的のために使うのに充分な機能を持っています. + このプロジェクトの第一の目的は、コンテナプロジェクトに参加するカーネル開発者の作業を快適にすることと、特に新機能である Checkpoint/Restart 機能への取り組みを続ける事です。 + lxc コマンドは、シンプルなコマンドでコンテナの管理を簡単に行えるように小さく、他の目的のために使うのに充分な機能を持っています。 @@ -123,8 +123,8 @@ by KATOH Yasufumi work with a restricted number of functionalities or will simply fail. --> - lxc は,カーネルが提供するいくつかの機能に依存しており,その機能がアクティブになっている必要があります. - 機能が足りない場合は,lxc は,いくつかの機能が制限されるか,単純に動作が失敗します. + lxc は、カーネルが提供するいくつかの機能に依存しており、その機能がアクティブになっている必要があります。 + 機能が足りない場合は、lxc は、いくつかの機能が制限されるか、単純に動作が失敗します。 @@ -132,7 +132,7 @@ by KATOH Yasufumi The following list gives the kernel features to be enabled in the kernel to have the full features container: --> - 以下のリストは,コンテナの全機能を有効にするために,カーネルで有効にする必要のある機能の一覧です. + 以下のリストは、コンテナの全機能を有効にするために、カーネルで有効にする必要のある機能の一覧です。 * General setup @@ -176,10 +176,10 @@ by KATOH Yasufumi The helper script lxc-checkconfig will give you information about your kernel configuration. --> - 2.6.27 以上のバージョンが採用されているディストリビューションならば,lxc は動作するでしょう. - 機能的には若干少ない形ですが,充分に楽しめるはずです. - 2.6.29 カーネルであれば,lxc は完全に機能します. - ヘルパースクリプトの lxc-checkconfig を使って,あなたのカーネルの設定に関する情報を取得できるでしょう. + 2.6.27 以上のバージョンが採用されているディストリビューションならば、lxc は動作するでしょう。 + 機能的には若干少ない形ですが、充分に楽しめるはずです。 + 2.6.29 カーネルであれば、lxc は完全に機能します。 + ヘルパースクリプトの lxc-checkconfig を使って、あなたのカーネルの設定に関する情報を取得できるでしょう。 @@ -188,7 +188,7 @@ by KATOH Yasufumi configured with the file capabilities, otherwise you will need to run the lxc commands as root. --> - lxc を使う前に,システムがファイルに対するケーパビリティーをえられるように設定するか,もしくは lxc コマンドを root で実行する必要があるでしょう. + lxc を使う前に、システムがファイルに対するケーパビリティーをえられるように設定するか、もしくは lxc コマンドを root で実行する必要があるでしょう。 @@ -205,10 +205,10 @@ by KATOH Yasufumi mount -t cgroup -ons,cpuset,freezer,devices lxc /cgroup4lxc --> - control group は,どこにでもマウント可能です. - 例えば,mount -t cgroup cgroup /cgroup のようにです. + control group は、どこにでもマウント可能です。 + 例えば、mount -t cgroup cgroup /cgroup のようにです。 - もし,異なる場所で,異なるオプションでマウントされた別々の cgroup を持ち,一つの場所の lxc コマンドを使うための,特定の lxc のための専用の cgroup のマウントポイントを提供したければ,lxc という名前でマウントポイントにバインドすることが出来ます.例えば以下のようにです. + もし、異なる場所で、異なるオプションでマウントされた別々の cgroup を持ち、一つの場所の lxc コマンドを使うための、特定の lxc のための専用の cgroup のマウントポイントを提供したければ、lxc という名前でマウントポイントにバインドすることが出来ます。例えば以下のようにです。 mount -t cgroup lxc /cgroup4lxc or mount -t cgroup -ons,cpuset,freezer,devices lxc /cgroup4lxc @@ -223,7 +223,7 @@ by KATOH Yasufumi A container is an object isolating some resources of the host, for the application or system running in it. --> - コンテナは,コンテナ内で実行されているシステムやアプリケーションに対するホストのリソースのいくつかが,隔離されているオブジェクトです. + コンテナは、コンテナ内で実行されているシステムやアプリケーションに対するホストのリソースのいくつかが、隔離されているオブジェクトです。 - アプリケーション/システムは,あらかじめ作成された設定もしくは開始コマンドのパラメータで指定された設定で,コンテナ内で実行されます. + アプリケーション/システムは、あらかじめ作成された設定もしくは開始コマンドのパラメータで指定された設定で、コンテナ内で実行されます。 @@ -259,13 +259,13 @@ by KATOH Yasufumi so you can still use your distro but with your own /etc and /home --> - アプリケーションを実行する前に,隔離したいリソースについて知っておくべきです. - デフォルトの設定では,pid,sysv ipc,マウントポイントが隔離されます. - コンテナ内でシンプルなシェルを実行したい場合で,特に rootfs を共有したい場合,基本的な設定が必要です. - もし,sshd のようなアプリケーションを実行したい場合,新しいネットワークスタックと,新しいホスト名を準備しなくてはなりません. - もし,同じファイル (/var/run/httpd.pid 等) の衝突を避けたい場合,空の /var/run/ を再度マウントしなければなりません. - どんな場合でも,衝突を避けたい場合,コンテナ専用の rootfs を指定することができます. - rootfs はディレクトリツリーとなる事も可能で,前もって元の rootfs を bind マウントし,しかし,自身の /etc/homeを使って.自身のディストリビューションを使うことが可能です. + アプリケーションを実行する前に、隔離したいリソースについて知っておくべきです。 + デフォルトの設定では、pid、sysv ipc、マウントポイントが隔離されます。 + コンテナ内でシンプルなシェルを実行したい場合で、特に rootfs を共有したい場合、基本的な設定が必要です。 + もし、sshd のようなアプリケーションを実行したい場合、新しいネットワークスタックと、新しいホスト名を準備しなくてはなりません。 + もし、同じファイル (/var/run/httpd.pid 等) の衝突を避けたい場合、空の /var/run/ を再度マウントしなければなりません。 + どんな場合でも、衝突を避けたい場合、コンテナ専用の rootfs を指定することができます。 + rootfs はディレクトリツリーとなる事も可能で、前もって元の rootfs を bind マウントし、しかし、自身の /etc/homeを使って。自身のディストリビューションを使うことが可能です。 - ここで,sshd のためのディレクトリツリーのサンプルを示しましょう. + ここで、sshd のためのディレクトリツリーのサンプルを示しましょう。 [root@lxc sshd]$ tree -d rootfs @@ -336,7 +336,7 @@ rootfs `-- sshd - そして,それに対応するマウントポイントのファイルは以下のようになります. + そして、それに対応するマウントポイントのファイルは以下のようになります。 [root@lxc sshd]$ cat fstab @@ -379,11 +379,11 @@ rootfs /etc/resolv.conf /home/root/debian/rootfs/etc/resolv.conf none bind 0 0 --> - コンテナ内でシステムを実行するのは,逆説的ではありますが,アプリケーションを実行するよりも簡単です. - それは,隔離するリソースについて考える必要がないからで,全てを隔離する必要があるからです. - 他のリソースは,コンテナが設定を行うので,設定なしで隔離されるように指定されます. - 例えば,IPv4 アドレスはコンテナの init スクリプトでシステムによってセットアップされるでしょう. - 以下に,(システムを実行するときの) マウントポイントファイルを示します. + コンテナ内でシステムを実行するのは、逆説的ではありますが、アプリケーションを実行するよりも簡単です。 + それは、隔離するリソースについて考える必要がないからで、全てを隔離する必要があるからです。 + 他のリソースは、コンテナが設定を行うので、設定なしで隔離されるように指定されます。 + 例えば、IPv4 アドレスはコンテナの init スクリプトでシステムによってセットアップされるでしょう。 + 以下に、(システムを実行するときの) マウントポイントファイルを示します。 [root@lxc debian]$ cat fstab @@ -392,8 +392,8 @@ rootfs /dev/pts /home/root/debian/rootfs/dev/pts none bind 0 0 - 設定を手助けするために,コンテナに更なる情報を追加することも可能です. - 例えば,ホスト上に存在する resolv.conf ファイルをコンテナからアクセス可能にするには,以下のようにします. + 設定を手助けするために、コンテナに更なる情報を追加することも可能です。 + 例えば、ホスト上に存在する resolv.conf ファイルをコンテナからアクセス可能にするには、以下のようにします。 /etc/resolv.conf /home/root/debian/rootfs/etc/resolv.conf none bind 0 0 @@ -409,16 +409,16 @@ rootfs starting and running. When the last process running inside the container exits, the container is stopped. --> - コンテナが作成されるとき,コンテナは設定情報を含みます. - プロセスが生成されるとき,コンテナは開始し,実行されるでしょう. - コンテナ内で実行されている最後のプロセスが終了したとき,コンテナは停止します. + コンテナが作成されるとき、コンテナは設定情報を含みます。 + プロセスが生成されるとき、コンテナは開始し、実行されるでしょう。 + コンテナ内で実行されている最後のプロセスが終了したとき、コンテナは停止します。 - コンテナの初期化時の失敗の場合は,(以下の図の) 中断の状態を通ります. + コンテナの初期化時の失敗の場合は、(以下の図の) 中断の状態を通ります。 @@ -463,7 +463,7 @@ rootfs --> - コンテナは設定ファイル経由で設定します.設定の書式は以下で説明しています. + コンテナは設定ファイル経由で設定します。設定の書式は以下で説明しています。 lxc.conf 5 @@ -488,10 +488,10 @@ rootfs lxc-destroy -n foo --> - 持続性のコンテナオブジェクトは lxc-create コマンドで作成することができます. - コマンドにはコンテナ名をパラメータとして,オプションで設定ファイルとテンプレートを指定します. - ここで指定する名前は,他のコマンドからこのコンテナを参照する際に使います. - lxc-destroy コマンドはコンテナオブジェクトを破壊します. + 持続性のコンテナオブジェクトは lxc-create コマンドで作成することができます。 + コマンドにはコンテナ名をパラメータとして、オプションで設定ファイルとテンプレートを指定します。 + ここで指定する名前は、他のコマンドからこのコンテナを参照する際に使います。 + lxc-destroy コマンドはコンテナオブジェクトを破壊します。 lxc-create -n foo lxc-destroy -n foo @@ -508,8 +508,8 @@ rootfs The container can be directly started with a configuration file as parameter. --> - コンテナを開始する前にコンテナオブジェクトを作成する必要はありません. - コンテナを設定ファイルのパラメータで指定して直接開始することができます. + コンテナを開始する前にコンテナオブジェクトを作成する必要はありません。 + コンテナを設定ファイルのパラメータで指定して直接開始することができます。 @@ -530,11 +530,11 @@ rootfs but if needed the lxc-stop command can be used to kill the still running application. --> - コンテナが作成されると,アプリケーションもしくはシステムとして実行することができます. - このために使用するのが lxc-executelxc-start コマンドです. - アプリケーションが開始する前にコンテナが作成されなかった場合,コンテナはコマンドへ与えるパラメータを取得するのに設定ファイルを使うでしょう. - もし,このようなパラメータもない場合は,デフォルトで指定されている通りに隔離されます. - アプリケーションが終了した場合,コンテナも停止しますが,実行中のアプリケーションを停止するには lxc-stop を使用する必要があります. + コンテナが作成されると、アプリケーションもしくはシステムとして実行することができます。 + このために使用するのが lxc-executelxc-start コマンドです。 + アプリケーションが開始する前にコンテナが作成されなかった場合、コンテナはコマンドへ与えるパラメータを取得するのに設定ファイルを使うでしょう。 + もし、このようなパラメータもない場合は、デフォルトで指定されている通りに隔離されます。 + アプリケーションが終了した場合、コンテナも停止しますが、実行中のアプリケーションを停止するには lxc-stop を使用する必要があります。 @@ -547,8 +547,8 @@ rootfs lxc-start -n foo [-f config] [/bin/bash] --> - コンテナ内のアプリケーションの実行は,正確にはシステムとして実行するのとは異なります. - そのような理由で,コンテナ内でアプリケーションを実行するためのコマンドには,2 種類の違ったものがあります. + コンテナ内のアプリケーションの実行は、正確にはシステムとして実行するのとは異なります。 + そのような理由で、コンテナ内でアプリケーションを実行するためのコマンドには、2 種類の違ったものがあります。 lxc-execute -n foo [-f config] /bin/bash lxc-start -n foo [-f config] [/bin/bash] @@ -567,9 +567,9 @@ rootfs container, lxc-init has the pid 1 and the first process of the application has the pid 2. --> - lxc-execute コマンドは,lxc-init プロセス経由で,コンテナ内で特定のコマンドを実行します. - lxc-init はコマンドを実行した後,(コンテナ内でのデーモンの実行をサポートするために) 実行したコマンドと生成された全てのプロセスが終了するのを待ちます. - 言いかえると,コンテナ内では lxc-init は pid 1 を持ち,アプリケーションの最初のプロセスは pid 2 をもちます. + lxc-execute コマンドは、lxc-init プロセス経由で、コンテナ内で特定のコマンドを実行します。 + lxc-init はコマンドを実行した後、(コンテナ内でのデーモンの実行をサポートするために) 実行したコマンドと生成された全てのプロセスが終了するのを待ちます。 + 言いかえると、コンテナ内では lxc-init は pid 1 を持ち、アプリケーションの最初のプロセスは pid 2 をもちます。 @@ -580,9 +580,9 @@ rootfs specified lxc-start will run /sbin/init. --> - lxc-start コマンドは,コンテナ内の特定のコマンドを直接実行します. - 最初のプロセスの pid が 1 となります. - もし,実行するコマンドが指定されない場合は,lxc-start/sbin/init を実行します. + lxc-start コマンドは、コンテナ内の特定のコマンドを直接実行します。 + 最初のプロセスの pid が 1 となります。 + もし、実行するコマンドが指定されない場合は、lxc-start/sbin/init を実行します。 @@ -591,7 +591,7 @@ rootfs an application and lxc-start is better suited for running a system. --> - まとめると,lxc-execute はアプリケーションを実行するためのコマンドであり,lxc-start はシステムを実行するのにより適したコマンドです. + まとめると、lxc-execute はアプリケーションを実行するためのコマンドであり、lxc-start はシステムを実行するのにより適したコマンドです。 @@ -604,7 +604,7 @@ rootfs lxc-stop -n foo --> - もしアプリケーションの反応がなくなった場合や,アクセスできなくなった場合,自分で終了することができない場合は,荒っぽいですが,lxc-stop コマンドがコンテナ内の全てのプロセスを容赦なく停止させてくれるでしょう. + もしアプリケーションの反応がなくなった場合や、アクセスできなくなった場合、自分で終了することができない場合は、荒っぽいですが、lxc-stop コマンドがコンテナ内の全てのプロセスを容赦なく停止させてくれるでしょう。 @@ -621,9 +621,9 @@ rootfs lxc-console -n foo -t 3 --> - コンテナが tty を持つように設定されているならば,tty を通してコンテナにアクセスすることができます. - それは以下のコマンドが使う tty がコンテナで利用可能に設定されているか次第です. - tty が失われたとき,再度のログインなしでその tty に再接続することが可能です. + コンテナが tty を持つように設定されているならば、tty を通してコンテナにアクセスすることができます。 + それは以下のコマンドが使う tty がコンテナで利用可能に設定されているか次第です。 + tty が失われたとき、再度のログインなしでその tty に再接続することが可能です。 lxc-console -n foo -t 3 @@ -648,18 +648,18 @@ rootfs will resume them. --> - ジョブスケジューリングなどで,コンテナに属する全てのプロセスを停止する事が役に立つときがあります. + ジョブスケジューリングなどで、コンテナに属する全てのプロセスを停止する事が役に立つときがあります。 コマンド lxc-freeze -n foo - は,全てのプロセスを中断不可能な状態に置きます.そして, + は、全てのプロセスを中断不可能な状態に置きます。そして、 lxc-unfreeze -n foo - その全てのプロセスを再開します. + その全てのプロセスを再開します。 @@ -667,7 +667,7 @@ rootfs This feature is enabled if the cgroup freezer is enabled in the kernel. --> - この機能は,カーネルで cgroup freezer 機能が有効になっている場合に使用可能です. + この機能は、カーネルで cgroup freezer 機能が有効になっている場合に使用可能です。 @@ -685,8 +685,8 @@ rootfs lxc-info -n foo --> - 多数のコンテナが存在する場合,それらが実行されたり破壊されたりすること,何が実行されていて,特定のコンテナ内で実行されている pid が何であるかをフォローするのは大変です. - このような時には,以下のようなコマンドが役に立つかもしれません. + 多数のコンテナが存在する場合、それらが実行されたり破壊されたりすること、何が実行されていて、特定のコンテナ内で実行されている pid が何であるかをフォローするのは大変です。 + このような時には、以下のようなコマンドが役に立つかもしれません。 lxc-ls lxc-info -n foo @@ -697,7 +697,7 @@ rootfs lxc-ls lists the containers of the system. --> - lxc-ls は,システムのコンテナを一覧します. + lxc-ls は、システムのコンテナを一覧します。 @@ -705,7 +705,7 @@ rootfs lxc-info gives information for a specific container. --> - lxc-info は,指定したコンテナに関する情報を取得します. + lxc-info は、指定したコンテナに関する情報を取得します。 @@ -718,7 +718,7 @@ rootfs done --> - ここで,以上のコマンドを組み合わせて,どのようにしたら全てのコンテナのリストと,それぞれの状態が得られるかの例を示します. + ここで、以上のコマンドを組み合わせて、どのようにしたら全てのコンテナのリストと、それぞれの状態が得られるかの例を示します。 for i in $(lxc-ls -1); do lxc-info -n $i @@ -736,8 +736,8 @@ rootfs for example to monitor it or just to wait for a specific state in a script. --> - 時々,コンテナの状態を追跡することが出来ると便利な事があります. - 例えば,状態をモニタリングしたり,スクリプト内で特定の状態を待ったりするような場合です. + 時々、コンテナの状態を追跡することが出来ると便利な事があります。 + 例えば、状態をモニタリングしたり、スクリプト内で特定の状態を待ったりするような場合です。 @@ -754,16 +754,16 @@ rootfs will monitor all the containers. --> - lxc-monitor コマンドは,一つもしくはいくつかのコンテナをモニタリングします. - このコマンドのパラメータは,正規表現を受け付けます.例えば + lxc-monitor コマンドは、一つもしくはいくつかのコンテナをモニタリングします。 + このコマンドのパラメータは、正規表現を受け付けます。例えば lxc-monitor -n "foo|bar" - は 'foo' と 'bar' という名前のコンテナの状態をモニタリングします.そして, + は 'foo' と 'bar' という名前のコンテナの状態をモニタリングします。そして、 lxc-monitor -n ".*" - は全てのコンテナの状態をモニタリングします. + は全てのコンテナの状態をモニタリングします。 - コンテナ 'foo' が開始され,いくつか処理を行い,終了した場合,出力は以下のようになります. + コンテナ 'foo' が開始され、いくつか処理を行い、終了した場合、出力は以下のようになります。 'foo' changed state to [STARTING] 'foo' changed state to [RUNNING] @@ -810,10 +810,10 @@ rootfs ]]> --> - lxc-wait コマンドは指定した状態を待って,終了します. - これは,コンテナの開始や終了に同期したいスクリプトで役に立ちます. - パラメータは,異なった状態の論理和 (OR) を指定します. - 以下の例は,バックグラウンドで実行されたコンテナをどのようにして待つかを示します. + lxc-wait コマンドは指定した状態を待って、終了します。 + これは、コンテナの開始や終了に同期したいスクリプトで役に立ちます。 + パラメータは、異なった状態の論理和 (OR) を指定します。 + 以下の例は、バックグラウンドで実行されたコンテナをどのようにして待つかを示します。 - コンテナは control group と結合しています. - コンテナが開始すると control group が生成され,それと結びつけられます. - control group のプロパティは,lxc-cgroup コマンドを使って,コンテナが実行中に読み取ったり,変更したりすることができます. + コンテナは control group と結合しています。 + コンテナが開始すると control group が生成され、それと結びつけられます。 + control group のプロパティは、lxc-cgroup コマンドを使って、コンテナが実行中に読み取ったり、変更したりすることができます。 - lxc-cgroup コマンドは,コンテナと結びつけられている control group サブシステムを設定したり,取得したりするのに使います. - サブシステム名の指定はユーザが行ない,このコマンドはサブシステム名の文法チェックは一切行ないません. - もし,指定したサブシステム名が存在しない場合は,コマンドの実行は失敗します. + lxc-cgroup コマンドは、コンテナと結びつけられている control group サブシステムを設定したり、取得したりするのに使います。 + サブシステム名の指定はユーザが行ない、このコマンドはサブシステム名の文法チェックは一切行ないません。 + もし、指定したサブシステム名が存在しない場合は、コマンドの実行は失敗します。 - lxc はまだ開発中です. - 従って,コマンドの文法や API は変更される可能性があります. - バージョン 1.0.0 がそれらを凍結するバージョンとなるでしょう. + lxc はまだ開発中です。 + 従って、コマンドの文法や API は変更される可能性があります。 + バージョン 1.0.0 がそれらを凍結するバージョンとなるでしょう。 diff --git a/doc/ja/lxc.system.conf.sgml.in b/doc/ja/lxc.system.conf.sgml.in index 10af574991..9ef669d5b3 100644 --- a/doc/ja/lxc.system.conf.sgml.in +++ b/doc/ja/lxc.system.conf.sgml.in @@ -61,8 +61,8 @@ by KATOH Yasufumi ~/.config/lxc/lxc.conf for unprivileged containers. --> - システム設定ファイルは @LXC_GLOBAL_CONF@ を使用します. - 非特権コンテナの場合には ~/.config/lxc/lxc.conf を使用します. + システム設定ファイルは @LXC_GLOBAL_CONF@ を使用します。 + 非特権コンテナの場合には ~/.config/lxc/lxc.conf を使用します。 @@ -70,7 +70,7 @@ by KATOH Yasufumi This configuration file is used to set values such as default lookup paths and storage backend settings for LXC. --> - この設定ファイルは LXC のデフォルトパスやストレージバックエンドの設定のような値を設定する時に使用します. + この設定ファイルは LXC のデフォルトパスやストレージバックエンドの設定のような値を設定する時に使用します。 @@ -86,7 +86,7 @@ by KATOH Yasufumi - 全てのコンテナが保存される場所. + 全てのコンテナが保存される場所。 @@ -99,7 +99,7 @@ by KATOH Yasufumi - コンテナのデフォルト設定ファイルのパス. + コンテナのデフォルト設定ファイルのパス。 @@ -119,7 +119,7 @@ by KATOH Yasufumi - 使用する cgroup コントローラのコンマ区切りのリスト. + 使用する cgroup コントローラのコンマ区切りのリスト。 @@ -132,7 +132,7 @@ by KATOH Yasufumi - コンテナ用の cgroup を生成する際に使うフォーマット文字列 (例. lxc/%n). + コンテナ用の cgroup を生成する際に使うフォーマット文字列 (例. lxc/%n)。 @@ -152,7 +152,7 @@ by KATOH Yasufumi - デフォルトの LVM の volume group 名. + デフォルトの LVM の volume group 名。 @@ -165,7 +165,7 @@ by KATOH Yasufumi - デフォルトの LVM の thin pool 名. + デフォルトの LVM の thin pool 名。 @@ -185,7 +185,7 @@ by KATOH Yasufumi - デフォルトの ZFS root 名. + デフォルトの ZFS root 名。 diff --git a/doc/lxc-autostart.sgml.in b/doc/lxc-autostart.sgml.in index 985cbe4363..8d42fc4cbc 100644 --- a/doc/lxc-autostart.sgml.in +++ b/doc/lxc-autostart.sgml.in @@ -153,8 +153,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Comma separate list of groups to select - (defaults to those without a lxc.group). + Comma separated list of groups to select + (defaults to those without a lxc.group - the NULL group). + This option may be specified multiple times + and the arguments concatenated. The NULL or + empty group may be specified as a leading comma, + trailing comma, embedded double comma, or empty + argument where the NULL group should be processed. + Groups are processed in the order specified on the + command line. Multiple invocations of the -g option + may be freely intermixed with the comma separated + lists and will be combined in specified order. @@ -172,6 +181,69 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + Autostart and System Boot + + + The lxc-autostart command is used as part of the + LXC system service, when enabled to run on host system at bootup and at + shutdown. It's used to select which containers to start in what order + and how much to delay between each startup when the host system boots. + + + + Each container can be part of any number of groups or no group at all. + Two groups are special. One is the NULL group, i.e. the container does + not belong to any group. The other group is the "onboot" group. + + + + When the system boots with the LXC service enabled, it will first + attempt to boot any containers with lxc.start.auto == 1 that is a member + of the "onboot" group. The startup will be in order of lxc.start.order. + If an lxc.start.delay has been specified, that delay will be honored + before attempting to start the next container to give the current + container time to begin initialization and reduce overloading the host + system. After starting the members of the "onboot" group, the LXC system + will proceed to boot containers with lxc.start.auto == 1 which are not + members of any group (the NULL group) and proceed as with the onboot + group. + + + + + Startup Group Examples + + + + + + + + Start the "onboot" group first then the NULL group. + + + This is the equivalent of: . + + + + + + + + + + Starts the "dns" group first, the "web" group second, then + the NULL group followed by the "onboot" group. + + + This is the equivalent of: or . + + + + + + &seealso; diff --git a/doc/lxc-clone.sgml.in b/doc/lxc-clone.sgml.in index c75afe8627..edd60327d9 100644 --- a/doc/lxc-clone.sgml.in +++ b/doc/lxc-clone.sgml.in @@ -177,7 +177,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + @@ -189,7 +189,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + @@ -203,7 +203,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + diff --git a/doc/lxc-create.sgml.in b/doc/lxc-create.sgml.in index ee5453d8c2..a4f9335d7c 100644 --- a/doc/lxc-create.sgml.in +++ b/doc/lxc-create.sgml.in @@ -125,13 +125,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - 'backingstore' is one of 'none', 'dir', 'lvm', 'loop', 'btrfs', or 'best'. The - default is 'none', meaning that the container root filesystem + 'backingstore' is one of 'dir', 'lvm', 'loop', 'btrfs', or 'best'. The + default is 'dir', meaning that the container root filesystem will be a directory under @LXCPATH@/container/rootfs. - 'dir' has the same meaning as 'none', but also allows the optional + This backing store type allows the optional --dir ROOTFS to be specified, meaning that the container rootfs should be placed under the specified path, - rather than the default. If 'btrfs' is specified, then the + rather than the default. (The 'none' backingstore type is an alias for + 'dir'.) If 'btrfs' is specified, then the target filesystem must be btrfs, and the container rootfs will be created as a new subvolume. This allows snapshotted clones to be created, but also causes rsync --one-filesystem to treat it as a diff --git a/doc/lxc-ls.sgml.in b/doc/lxc-ls.sgml.in index 1c40d33de3..8bd38a2229 100644 --- a/doc/lxc-ls.sgml.in +++ b/doc/lxc-ls.sgml.in @@ -144,7 +144,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Comma separate list of column to show in the fancy output. + Comma separated list of column to show in the fancy output. The list of accepted and default fields is listed in --help. diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in index 7bd2c9e84c..d3533de549 100644 --- a/doc/lxc.container.conf.sgml.in +++ b/doc/lxc.container.conf.sgml.in @@ -672,13 +672,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA specify a file location in the fstab format, containing the - mount information. If the rootfs is an image file or a - block device and the fstab is used to mount a point - somewhere in this rootfs, the path of the rootfs mount - point should be prefixed with the - @LXCROOTFSMOUNT@ default path or - the value of if - specified. Note that when mounting a filesystem from an + mount information. The mount target location can and in + most cases should be a relative path, which will become + relative to the mounted container root. For instance, + + +proc proc proc nodev,noexec,nosuid 0 0 + + + Will mount a proc filesystem under the container's /proc, + regardless of where the root filesystem comes from. This + is resilient to block device backed filesystems as well as + container cloning. + + + Note that when mounting a filesystem from an image file or block device the third field (fs_vfstype) cannot be auto as with @@ -743,8 +751,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - (or - ): + : mount a tmpfs to /sys/fs/cgroup, create directories for all hierarchies to which the container is added, create subdirectories @@ -774,8 +781,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - (or - ): + (without specifier): + defaults to if the + container retains the CAP_SYS_ADMIN capability, + otherwise. + + + + + : mount a tmpfs to /sys/fs/cgroup, create directories for all hierarchies to which the container is added, bind-mount the hierarchies @@ -810,7 +824,35 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA do so anyway.) + + + (without specifier): + defaults to if the + container retains the CAP_SYS_ADMIN capability, + otherwise. + + + + Note that if automatic mounting of the cgroup filesystem + is enabled, the tmpfs under + /sys/fs/cgroup will always be + mounted read-write (but for the + and cases, the individual + hierarchies, + /sys/fs/cgroup/$hierarchy, will be + read-only). This is in order to work around a quirk in + Ubuntu's + + mountall + 8 + + command that will cause containers to wait for user + input at boot if + /sys/fs/cgroup is mounted read-only + and the container can't remount it read-write due to a + lack of CAP_SYS_ADMIN. + Examples: @@ -1430,6 +1472,29 @@ mknod errno 0 + + + Autostart and System Boot + + Each container can be part of any number of groups or no group at all. + Two groups are special. One is the NULL group, i.e. the container does + not belong to any group. The other group is the "onboot" group. + + + + When the system boots with the LXC service enabled, it will first + attempt to boot any containers with lxc.start.auto == 1 that is a member + of the "onboot" group. The startup will be in order of lxc.start.order. + If an lxc.start.delay has been specified, that delay will be honored + before attempting to start the next container to give the current + container time to begin initialization and reduce overloading the host + system. After starting the members of the "onboot" group, the LXC system + will proceed to boot containers with lxc.start.auto == 1 which are not + members of any group (the NULL group) and proceed as with the onboot + group. + + + diff --git a/lxc.spec b/lxc.spec index 5759262946..3933b87ad1 100644 --- a/lxc.spec +++ b/lxc.spec @@ -45,7 +45,7 @@ BuildRequires: systemd-units %endif Name: lxc -Version: 1.0.3 +Version: 1.0.4 Release: %{?beta_rel:0.1.%{beta_rel}}%{?!beta_rel:%{norm_rel}}%{?dist} URL: http://linuxcontainers.org Source: http://linuxcontainers.org/downloads/%{name}-%{version}%{?beta_dot}.tar.gz @@ -154,6 +154,7 @@ rm -rf %{buildroot} %attr(4111,root,root) %{_libexecdir}/%{name}/lxc-user-nic %if %{with_systemd} %attr(555,root,root) %{_libexecdir}/%{name}/lxc-devsetup +%attr(555,root,root) %{_libexecdir}/%{name}/lxc-autostart-helper %endif %if %{with_python} diff --git a/lxc.spec.in b/lxc.spec.in index 2717c83792..57912a1fe4 100644 --- a/lxc.spec.in +++ b/lxc.spec.in @@ -154,6 +154,7 @@ rm -rf %{buildroot} %attr(4111,root,root) %{_libexecdir}/%{name}/lxc-user-nic %if %{with_systemd} %attr(555,root,root) %{_libexecdir}/%{name}/lxc-devsetup +%attr(555,root,root) %{_libexecdir}/%{name}/lxc-autostart-helper %endif %if %{with_python} diff --git a/src/config.h.in b/src/config.h.in index e50cbbaa97..1d7535dcd0 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -3,6 +3,9 @@ /* Python3 is available */ #undef ENABLE_PYTHON +/* Have cgmanager_get_pid_cgroup_abs_sync */ +#undef HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC + /* Define to 1 if you have the `confstr' function. */ #undef HAVE_CONFSTR diff --git a/src/lxc/af_unix.h b/src/lxc/af_unix.h index 81f2986968..3f5d01fe1c 100644 --- a/src/lxc/af_unix.h +++ b/src/lxc/af_unix.h @@ -21,6 +21,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef __LXC_AF_UNIX_H +#define __LXC_AF_UNIX_H + extern int lxc_abstract_unix_open(const char *path, int type, int flags); extern int lxc_abstract_unix_close(int fd); extern int lxc_abstract_unix_connect(const char *path); @@ -29,3 +32,4 @@ extern int lxc_abstract_unix_recv_fd(int fd, int *recvfd, void *data, size_t siz extern int lxc_abstract_unix_send_credential(int fd, void *data, size_t size); extern int lxc_abstract_unix_rcv_credential(int fd, void *data, size_t size); +#endif diff --git a/src/lxc/arguments.h b/src/lxc/arguments.h index 767bfcfc79..609e814c2c 100644 --- a/src/lxc/arguments.h +++ b/src/lxc/arguments.h @@ -21,8 +21,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __arguments_h -#define __arguments_h +#ifndef __LXC_ARGUMENTS_H +#define __LXC_ARGUMENTS_H #include #include diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 842a509af6..3bab957536 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -55,6 +55,7 @@ #include "lxcseccomp.h" #include #include "lsm/lsm.h" +#include "confile.h" #if HAVE_SYS_PERSONALITY_H #include @@ -116,23 +117,6 @@ static struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid) goto out_error; } - /* read personality */ - snprintf(proc_fn, MAXPATHLEN, "/proc/%d/personality", pid); - - proc_file = fopen(proc_fn, "r"); - if (!proc_file) { - SYSERROR("Could not open %s", proc_fn); - goto out_error; - } - - ret = fscanf(proc_file, "%lx", &info->personality); - fclose(proc_file); - - if (ret == EOF || ret == 0) { - SYSERROR("Could not read personality from %s", proc_fn); - errno = ENOENT; - goto out_error; - } info->lsm_label = lsm_process_label_get(pid); return info; @@ -635,6 +619,18 @@ static bool fetch_seccomp(const char *name, const char *lxcpath, return true; } +static signed long get_personality(const char *name, const char *lxcpath) +{ + char *p = lxc_cmd_get_config_item(name, "lxc.personality", lxcpath); + signed long ret; + + if (!p) + return -1; + ret = lxc_config_parse_arch(p); + free(p); + return ret; +} + int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_function, void* exec_payload, lxc_attach_options_t* options, pid_t* attached_process) { int ret, status; @@ -643,6 +639,7 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun char* cwd; char* new_cwd; int ipc_sockets[2]; + signed long personality; if (!options) options = &attach_static_default_options; @@ -659,6 +656,14 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun return -1; } + personality = get_personality(name, lxcpath); + if (init_ctx->personality < 0) { + ERROR("Failed to get personality of the container"); + lxc_proc_put_context_info(init_ctx); + return -1; + } + init_ctx->personality = personality; + if (!fetch_seccomp(name, lxcpath, init_ctx, options)) WARN("Failed to get seccomp policy"); diff --git a/src/lxc/attach.h b/src/lxc/attach.h index 8c833b16fd..39fcab783b 100644 --- a/src/lxc/attach.h +++ b/src/lxc/attach.h @@ -21,8 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _attach_h -#define _attach_h +#ifndef __LXC_ATTACH_H +#define __LXC_ATTACH_H #include #include @@ -32,7 +32,7 @@ struct lxc_conf; struct lxc_proc_context_info { char *lsm_label; struct lxc_container *container; - unsigned long personality; + signed long personality; unsigned long long capability_mask; }; diff --git a/src/lxc/attach_options.h b/src/lxc/attach_options.h index c7295fbf7f..b035318ab0 100644 --- a/src/lxc/attach_options.h +++ b/src/lxc/attach_options.h @@ -22,8 +22,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _LXC_ATTACH_OPTIONS_H -#define _LXC_ATTACH_OPTIONS_H +#ifndef __LXC_ATTACH_OPTIONS_H +#define __LXC_ATTACH_OPTIONS_H #include diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 49ba8ae674..0d55c9dcfc 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -66,6 +66,11 @@ lxc_log_define(bdev, lxc); +struct rsync_data_char { + char *src; + char *dest; +}; + static int do_rsync(const char *src, const char *dest) { // call out to rsync @@ -1433,6 +1438,22 @@ static int btrfs_snapshot(const char *orig, const char *new) return ret; } +static int btrfs_snapshot_wrapper(void *data) +{ + struct rsync_data_char *arg = data; + if (setgid(0) < 0) { + ERROR("Failed to setgid to 0"); + return -1; + } + if (setgroups(0, NULL) < 0) + WARN("Failed to clear groups"); + if (setuid(0) < 0) { + ERROR("Failed to setuid to 0"); + return -1; + } + return btrfs_snapshot(arg->src, arg->dest); +} + static int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *oldname, const char *cname, const char *oldpath, const char *lxcpath, int snap, uint64_t newsize, struct lxc_conf *conf) @@ -1467,8 +1488,14 @@ static int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *old if (orig->mntopts && (new->mntopts = strdup(orig->mntopts)) == NULL) return -1; - if (snap) - return btrfs_snapshot(orig->dest, new->dest); + if (snap) { + struct rsync_data_char sdata; + if (!am_unpriv()) + return btrfs_snapshot(orig->dest, new->dest); + sdata.dest = new->dest; + sdata.src = orig->dest; + return userns_exec_1(conf, btrfs_snapshot_wrapper, &sdata); + } if (rmdir(new->dest) < 0 && errno != -ENOENT) { SYSERROR("removing %s", new->dest); @@ -1510,6 +1537,8 @@ static int btrfs_destroy(struct bdev *orig) args.name[BTRFS_SUBVOL_NAME_MAX-1] = 0; ret = ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args); INFO("btrfs: snapshot create ioctl returned %d", ret); + if (ret < 0 && errno == EPERM) + INFO("Is the rootfs mounted with -o user_subvol_rm_allowed?"); free(newfull); close(fd); @@ -1887,11 +1916,6 @@ static int overlayfs_umount(struct bdev *bdev) return umount(bdev->dest); } -struct rsync_data_char { - char *src; - char *dest; -}; - static int rsync_delta(struct rsync_data_char *data) { if (setgid(0) < 0) { @@ -2430,11 +2454,9 @@ struct bdev *bdev_get(const char *type) return bdev; } -struct bdev *bdev_init(const char *src, const char *dst, const char *mntopts) +static const struct bdev_type *bdev_query(const char *src) { int i; - struct bdev *bdev; - for (i=0; idetect(src); @@ -2444,12 +2466,24 @@ struct bdev *bdev_init(const char *src, const char *dst, const char *mntopts) if (i == numbdevs) return NULL; + return &bdevs[i]; +} + +struct bdev *bdev_init(const char *src, const char *dst, const char *mntopts) +{ + struct bdev *bdev; + const struct bdev_type *q; + + q = bdev_query(src); + if (!q) + return NULL; + bdev = malloc(sizeof(struct bdev)); if (!bdev) return NULL; memset(bdev, 0, sizeof(struct bdev)); - bdev->ops = bdevs[i].ops; - bdev->type = bdevs[i].name; + bdev->ops = q->ops; + bdev->type = q->name; if (mntopts) bdev->mntopts = strdup(mntopts); if (src) @@ -2538,6 +2572,7 @@ static bool unpriv_snap_allowed(struct bdev *b, const char *t, bool snap, // overlayfs -- which is also allowed) if (strcmp(b->type, "dir") == 0 || strcmp(b->type, "overlayfs") == 0 || + strcmp(b->type, "btrfs") == 0 || strcmp(b->type, "loop") == 0) return true; return false; @@ -2546,7 +2581,7 @@ static bool unpriv_snap_allowed(struct bdev *b, const char *t, bool snap, // unprivileged users can copy and snapshot dir, overlayfs, // and loop. In particular, not zfs, btrfs, or lvm. if (strcmp(t, "dir") == 0 || strcmp(t, "overlayfs") == 0 || - strcmp(t, "loop") == 0) + strcmp(t, "btrfs") == 0 || strcmp(t, "loop") == 0) return true; return false; } @@ -2769,3 +2804,22 @@ char *overlay_getlower(char *p) *p1 = '\0'; return p; } + +bool rootfs_is_blockdev(struct lxc_conf *conf) +{ + const struct bdev_type *q; + struct stat st; + int ret; + + ret = stat(conf->rootfs.path, &st); + if (ret == 0 && S_ISBLK(st.st_mode)) + return true; + q = bdev_query(conf->rootfs.path); + if (!q) + return false; + if (strcmp(q->name, "lvm") == 0 || + strcmp(q->name, "loop") == 0 || + strcmp(q->name, "nbd") == 0) + return true; + return false; +} diff --git a/src/lxc/bdev.h b/src/lxc/bdev.h index cc0bf02bfb..3dcb96174f 100644 --- a/src/lxc/bdev.h +++ b/src/lxc/bdev.h @@ -34,23 +34,6 @@ struct bdev; -/* - * specifications for how to create a new backing store - */ -struct bdev_specs { - char *fstype; - uint64_t fssize; // fs size in bytes - struct { - char *zfsroot; - } zfs; - struct { - char *vg; - char *lv; - char *thinpool; // lvm thin pool to use, if any - } lvm; - char *dir; -}; - struct bdev_ops { /* detect whether path is of this bdev type */ int (*detect)(const char *path); @@ -110,6 +93,8 @@ struct bdev *bdev_create(const char *dest, const char *type, const char *cname, struct bdev_specs *specs); void bdev_put(struct bdev *bdev); +bool rootfs_is_blockdev(struct lxc_conf *conf); + /* define constants if the kernel/glibc headers don't define them */ #ifndef MS_DIRSYNC #define MS_DIRSYNC 128 diff --git a/src/lxc/caps.h b/src/lxc/caps.h index 1ea32aed4e..daa8b6188d 100644 --- a/src/lxc/caps.h +++ b/src/lxc/caps.h @@ -22,8 +22,8 @@ */ #include "config.h" -#ifndef _caps_h -#define _caps_h +#ifndef __LXC_CAPS_H +#define __LXC_CAPS_H #if HAVE_SYS_CAPABILITY_H extern int lxc_caps_reset(void); diff --git a/src/lxc/cgfs.c b/src/lxc/cgfs.c index db2a973ce2..796b2202fe 100644 --- a/src/lxc/cgfs.c +++ b/src/lxc/cgfs.c @@ -953,7 +953,7 @@ static struct cgroup_process_info *lxc_cgroupfs_create(const char *name, const c current_entire_path = NULL; goto cleanup_name_on_this_level; } else if (r < 0 && errno != EEXIST) { - SYSERROR("Could not create cgroup %s", current_entire_path); + SYSERROR("Could not create cgroup '%s' in '%s'.", current_entire_path, info_ptr->designated_mount_point->mount_point); goto cleanup_from_error; } else if (r == 0) { /* successfully created */ @@ -961,7 +961,7 @@ static struct cgroup_process_info *lxc_cgroupfs_create(const char *name, const c if (r < 0) goto cleanup_from_error; if (!init_cpuset_if_needed(info_ptr->designated_mount_point, current_entire_path)) { - ERROR("Failed to initialize cpuset in new '%s'.", current_entire_path); + ERROR("Failed to initialize cpuset for '%s' in '%s'.", current_entire_path, info_ptr->designated_mount_point->mount_point); goto cleanup_from_error; } info_ptr->created_paths[info_ptr->created_paths_count++] = current_entire_path; @@ -1344,6 +1344,15 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type) return false; base_info = cgfs_d->info; + /* If we get passed the _NOSPEC types, we default to _MIXED, since we don't + * have access to the lxc_conf object at this point. It really should be up + * to the caller to fix this, but this doesn't really hurt. + */ + if (type == LXC_AUTO_CGROUP_FULL_NOSPEC) + type = LXC_AUTO_CGROUP_FULL_MIXED; + else if (type == LXC_AUTO_CGROUP_NOSPEC) + type = LXC_AUTO_CGROUP_MIXED; + if (type < LXC_AUTO_CGROUP_RO || type > LXC_AUTO_CGROUP_FULL_MIXED) { ERROR("could not mount cgroups into container: invalid type specified internally"); errno = EINVAL; @@ -1442,6 +1451,24 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type) goto out_error; } + /* for read-only and mixed cases, we have to bind-mount the tmpfs directory + * that points to the hierarchy itself (i.e. /sys/fs/cgroup/cpu etc.) onto + * itself and then bind-mount it read-only, since we keep the tmpfs itself + * read-write (see comment below) + */ + if (type == LXC_AUTO_CGROUP_MIXED || type == LXC_AUTO_CGROUP_RO) { + r = mount(abs_path, abs_path, NULL, MS_BIND, NULL); + if (r < 0) { + SYSERROR("error bind-mounting %s onto itself", abs_path); + goto out_error; + } + r = mount(NULL, abs_path, NULL, MS_REMOUNT|MS_BIND|MS_RDONLY, NULL); + if (r < 0) { + SYSERROR("error re-mounting %s readonly", abs_path); + goto out_error; + } + } + free(abs_path); abs_path = NULL; @@ -1487,13 +1514,21 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type) parts = NULL; } - /* try to remount the tmpfs readonly, since the container shouldn't - * change anything (this will also make sure that trying to create - * new cgroups outside the allowed area fails with an error instead - * of simply causing this to create directories in the tmpfs itself) + /* We used to remount the entire tmpfs readonly if any :ro or + * :mixed mode was specified. However, Ubuntu's mountall has the + * unfortunate behavior to block bootup if /sys/fs/cgroup is + * mounted read-only and cannot be remounted read-write. + * (mountall reads /lib/init/fstab and tries to (re-)mount all of + * these if they are not already mounted with the right options; + * it contains an entry for /sys/fs/cgroup. In case it can't do + * that, it prompts for the user to either manually fix it or + * boot anyway. But without user input, booting of the container + * hangs.) + * + * Instead of remounting the entire tmpfs readonly, we only + * remount the paths readonly that are part of the cgroup + * hierarchy. */ - if (type != LXC_AUTO_CGROUP_RW && type != LXC_AUTO_CGROUP_FULL_RW) - mount(NULL, path, NULL, MS_REMOUNT|MS_RDONLY, NULL); free(path); diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c index 1dea824b9e..3a5525aba5 100644 --- a/src/lxc/cgmanager.c +++ b/src/lxc/cgmanager.c @@ -51,6 +51,9 @@ #include "start.h" #include "state.h" +#define CGM_SUPPORTS_GET_ABS 3 +#define CGM_SUPPORTS_NAMED 4 + #ifdef HAVE_CGMANAGER lxc_log_define(lxc_cgmanager, lxc); @@ -107,11 +110,13 @@ static void process_lock_setup_atfork(void) #endif static NihDBusProxy *cgroup_manager = NULL; +static int32_t api_version; static struct cgroup_ops cgmanager_ops; static int nr_subsystems; static char **subsystems; static bool dbus_threads_initialized = false; +static void cull_user_controllers(void); static void cgm_dbus_disconnect(void) { @@ -147,17 +152,6 @@ static bool cgm_dbus_connect(void) cgm_unlock(); return false; } - if (nih_dbus_setup(connection, NULL) < 0) { - NihError *nerr; - nerr = nih_error_get(); - DEBUG("Unable to open cgmanager connection at %s: %s", CGMANAGER_DBUS_SOCK, - nerr->message); - nih_free(nerr); - dbus_error_free(&dbus_error); - dbus_connection_unref(connection); - cgm_unlock(); - return false; - } dbus_connection_set_exit_on_disconnect(connection, FALSE); dbus_error_free(&dbus_error); cgroup_manager = nih_dbus_proxy_new(NULL, connection, @@ -173,15 +167,17 @@ static bool cgm_dbus_connect(void) return false; } - // force fd passing negotiation - if (cgmanager_ping_sync(NULL, cgroup_manager, 0) != 0) { + // get the api version + if (cgmanager_get_api_version_sync(NULL, cgroup_manager, &api_version) != 0) { NihError *nerr; nerr = nih_error_get(); - ERROR("Error pinging cgroup manager: %s", nerr->message); + ERROR("Error cgroup manager api version: %s", nerr->message); nih_free(nerr); cgm_dbus_disconnect(); return false; } + if (api_version < CGM_SUPPORTS_NAMED) + cull_user_controllers(); return true; } @@ -565,13 +561,21 @@ static inline bool cgm_create(void *hdata) * Internal helper, must be called with cgmanager dbus socket open */ static bool lxc_cgmanager_enter(pid_t pid, const char *controller, - const char *cgroup_path) + const char *cgroup_path, bool abs) { - if (cgmanager_move_pid_sync(NULL, cgroup_manager, controller, - cgroup_path, pid) != 0) { + int ret; + + if (abs) + ret = cgmanager_move_pid_abs_sync(NULL, cgroup_manager, + controller, cgroup_path, pid); + else + ret = cgmanager_move_pid_sync(NULL, cgroup_manager, + controller, cgroup_path, pid); + if (ret != 0) { NihError *nerr; nerr = nih_error_get(); - ERROR("call to cgmanager_move_pid_sync failed: %s", nerr->message); + ERROR("call to cgmanager_move_pid_%ssync failed: %s", + abs ? "abs_" : "", nerr->message); nih_free(nerr); return false; } @@ -579,12 +583,12 @@ static bool lxc_cgmanager_enter(pid_t pid, const char *controller, } /* Internal helper, must be called with cgmanager dbus socket open */ -static bool do_cgm_enter(pid_t pid, const char *cgroup_path) +static bool do_cgm_enter(pid_t pid, const char *cgroup_path, bool abs) { int i; for (i = 0; i < nr_subsystems; i++) { - if (!lxc_cgmanager_enter(pid, subsystems[i], cgroup_path)) + if (!lxc_cgmanager_enter(pid, subsystems[i], cgroup_path, abs)) return false; } return true; @@ -601,7 +605,7 @@ static inline bool cgm_enter(void *hdata, pid_t pid) } if (!d || !d->cgroup_path) goto out; - if (do_cgm_enter(pid, d->cgroup_path)) + if (do_cgm_enter(pid, d->cgroup_path, false)) ret = true; out: cgm_dbus_disconnect(); @@ -617,6 +621,41 @@ static const char *cgm_get_cgroup(void *hdata, const char *subsystem) return d->cgroup_path; } +#if HAVE_CGMANAGER_GET_PID_CGROUP_ABS_SYNC +static inline bool abs_cgroup_supported(void) { + return api_version >= CGM_SUPPORTS_GET_ABS; +} +#else +static inline bool abs_cgroup_supported(void) { + return false; +} +#define cgmanager_get_pid_cgroup_abs_sync(...) -1 +#endif + +static char *try_get_abs_cgroup(const char *name, const char *lxcpath, + const char *controller) +{ + char *cgroup = NULL; + + if (abs_cgroup_supported()) { + /* get the container init pid and ask for its abs cgroup */ + pid_t pid = lxc_cmd_get_init_pid(name, lxcpath); + if (pid < 0) + return NULL; + if (cgmanager_get_pid_cgroup_abs_sync(NULL, cgroup_manager, + controller, pid, &cgroup) != 0) { + cgroup = NULL; + NihError *nerr; + nerr = nih_error_get(); + nih_free(nerr); + } + return cgroup; + } + + /* use the command interface to look for the cgroup */ + return lxc_cmd_get_cgroup_path(name, lxcpath, controller); +} + /* * nrtasks is called by the utmp helper by the container monitor. * cgmanager socket was closed after cgroup setup was complete, so we need @@ -652,10 +691,20 @@ static int cgm_get_nrtasks(void *hdata) return pids_len; } +static inline void free_abs_cgroup(char *cgroup) +{ + if (!cgroup) + return; + if (abs_cgroup_supported()) + nih_free(cgroup); + else + free(cgroup); +} + /* cgm_get is called to get container cgroup settings, not during startup */ static int cgm_get(const char *filename, char *value, size_t len, const char *name, const char *lxcpath) { - char *result, *controller, *key, *cgroup; + char *result, *controller, *key, *cgroup = NULL; size_t newlen; controller = alloca(strlen(filename)+1); @@ -669,10 +718,12 @@ static int cgm_get(const char *filename, char *value, size_t len, const char *na cgroup = lxc_cmd_get_cgroup_path(name, lxcpath, controller); if (!cgroup) return -1; + if (!cgm_dbus_connect()) { ERROR("Error connecting to cgroup manager"); return -1; } + if (cgmanager_get_value_sync(NULL, cgroup_manager, controller, cgroup, filename, &result) != 0) { /* * must consume the nih error @@ -728,7 +779,7 @@ static int cgm_do_set(const char *controller, const char *file, /* cgm_set is called to change cgroup settings, not during startup */ static int cgm_set(const char *filename, const char *value, const char *name, const char *lxcpath) { - char *controller, *key, *cgroup; + char *controller, *key, *cgroup = NULL; int ret; controller = alloca(strlen(filename)+1); @@ -745,6 +796,7 @@ static int cgm_set(const char *filename, const char *value, const char *name, co controller, lxcpath, name); return -1; } + if (!cgm_dbus_connect()) { ERROR("Error connecting to cgroup manager"); free(cgroup); @@ -767,41 +819,68 @@ static void free_subsystems(void) nr_subsystems = 0; } +static void cull_user_controllers(void) +{ + int i, j; + + for (i = 0; i < nr_subsystems; i++) { + if (strncmp(subsystems[i], "name=", 5) != 0) + continue; + for (j = i; j < nr_subsystems-1; j++) + subsystems[j] = subsystems[j+1]; + nr_subsystems--; + } +} + static bool collect_subsytems(void) { - char *line = NULL, *tab1; + char *line = NULL; size_t sz = 0; FILE *f; if (subsystems) // already initialized return true; - f = fopen_cloexec("/proc/cgroups", "r"); + f = fopen_cloexec("/proc/self/cgroup", "r"); if (!f) { - return false; + f = fopen_cloexec("/proc/1/cgroup", "r"); + if (!f) + return false; } while (getline(&line, &sz, f) != -1) { - char **tmp; - if (line[0] == '#') - continue; + /* file format: hierarchy:subsystems:group, + * with multiple subsystems being ,-separated */ + char *slist, *end, *p, *saveptr = NULL, **tmp; + if (!line[0]) continue; - tab1 = strchr(line, '\t'); - if (!tab1) + + slist = strchr(line, ':'); + if (!slist) + continue; + slist++; + end = strchr(slist, ':'); + if (!end) continue; - *tab1 = '\0'; - tmp = realloc(subsystems, (nr_subsystems+1)*sizeof(char *)); - if (!tmp) - goto out_free; - - subsystems = tmp; - tmp[nr_subsystems] = strdup(line); - if (!tmp[nr_subsystems]) - goto out_free; - nr_subsystems++; + *end = '\0'; + + for (p = strtok_r(slist, ",", &saveptr); + p; + p = strtok_r(NULL, ",", &saveptr)) { + tmp = realloc(subsystems, (nr_subsystems+1)*sizeof(char *)); + if (!tmp) + goto out_free; + + subsystems = tmp; + tmp[nr_subsystems] = strdup(p); + if (!tmp[nr_subsystems]) + goto out_free; + nr_subsystems++; + } } fclose(f); + free(line); if (!nr_subsystems) { ERROR("No cgroup subsystems found"); return false; @@ -810,6 +889,7 @@ static bool collect_subsytems(void) return true; out_free: + free(line); fclose(f); free_subsystems(); return false; @@ -943,36 +1023,29 @@ static bool cgm_chown(void *hdata, struct lxc_conf *conf) */ static bool cgm_attach(const char *name, const char *lxcpath, pid_t pid) { - bool pass = false; + bool pass; char *cgroup = NULL; - struct lxc_container *c; - c = lxc_container_new(name, lxcpath); - if (!c) { - ERROR("Could not load container %s:%s", lxcpath, name); + if (!cgm_dbus_connect()) { + ERROR("Error connecting to cgroup manager"); return false; } // cgm_create makes sure that we have the same cgroup name for all // subsystems, so since this is a slow command over the cmd socket, // just get the cgroup name for the first one. - cgroup = lxc_cmd_get_cgroup_path(name, lxcpath, subsystems[0]); + cgroup = try_get_abs_cgroup(name, lxcpath, subsystems[0]); if (!cgroup) { ERROR("Failed to get cgroup for controller %s", subsystems[0]); - goto out; + cgm_dbus_disconnect(); + return false; } - if (!cgm_dbus_connect()) { - ERROR("Error connecting to cgroup manager"); - goto out; - } - pass = do_cgm_enter(pid, cgroup); + pass = do_cgm_enter(pid, cgroup, abs_cgroup_supported()); cgm_dbus_disconnect(); if (!pass) ERROR("Failed to enter group %s", cgroup); -out: - free(cgroup); - lxc_container_put(c); + free_abs_cgroup(cgroup); return pass; } diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h index 3e222a8c15..7e033702f9 100644 --- a/src/lxc/cgroup.h +++ b/src/lxc/cgroup.h @@ -21,8 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __lxc_cgroup_h -#define __lxc_cgroup_h +#ifndef __LXC_CGROUP_H +#define __LXC_CGROUP_H #include #include diff --git a/src/lxc/commands.c b/src/lxc/commands.c index b71274c3e2..458d41e1f7 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -136,8 +136,8 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd) ret = lxc_abstract_unix_recv_fd(sock, &rspfd, rsp, sizeof(*rsp)); if (ret < 0) { - ERROR("command %s failed to receive response", - lxc_cmd_str(cmd->req.cmd)); + WARN("command %s failed to receive response", + lxc_cmd_str(cmd->req.cmd)); return -1; } diff --git a/src/lxc/commands.h b/src/lxc/commands.h index 7829aef22a..9efe2ad430 100644 --- a/src/lxc/commands.h +++ b/src/lxc/commands.h @@ -21,8 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __commands_h -#define __commands_h +#ifndef __LXC_COMMANDS_H +#define __LXC_COMMANDS_H #include "state.h" diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 06235fb653..7b7f20fd6c 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -115,6 +115,12 @@ lxc_log_define(lxc_conf, lxc); #define LO_FLAGS_AUTOCLEAR 4 #endif +/* needed for cgroup automount checks, regardless of whether we + * have included linux/capability.h or not */ +#ifndef CAP_SYS_ADMIN +#define CAP_SYS_ADMIN 21 +#endif + /* Define pivot_root() if missing from the C library */ #ifndef HAVE_PIVOT_ROOT static int pivot_root(const char * new_root, const char * put_old) @@ -164,6 +170,9 @@ struct caps_opt { int value; }; +/* Declare this here, since we don't want to reshuffle the whole file. */ +static int in_caplist(int cap, struct lxc_list *caps); + static int instanciate_veth(struct lxc_handler *, struct lxc_netdev *); static int instanciate_macvlan(struct lxc_handler *, struct lxc_netdev *); static int instanciate_vlan(struct lxc_handler *, struct lxc_netdev *); @@ -743,8 +752,32 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha } if (flags & LXC_AUTO_CGROUP_MASK) { - if (!cgroup_mount(conf->rootfs.mount, handler, - flags & LXC_AUTO_CGROUP_MASK)) { + int cg_flags; + + cg_flags = flags & LXC_AUTO_CGROUP_MASK; + /* If the type of cgroup mount was not specified, it depends on the + * container's capabilities as to what makes sense: if we have + * CAP_SYS_ADMIN, the read-only part can be remounted read-write + * anyway, so we may as well default to read-write; then the admin + * will not be given a false sense of security. (And if they really + * want mixed r/o r/w, then they can explicitly specify :mixed.) + * OTOH, if the container lacks CAP_SYS_ADMIN, do only default to + * :mixed, because then the container can't remount it read-write. */ + if (cg_flags == LXC_AUTO_CGROUP_NOSPEC || cg_flags == LXC_AUTO_CGROUP_FULL_NOSPEC) { + int has_sys_admin = 0; + if (!lxc_list_empty(&conf->keepcaps)) { + has_sys_admin = in_caplist(CAP_SYS_ADMIN, &conf->keepcaps); + } else { + has_sys_admin = !in_caplist(CAP_SYS_ADMIN, &conf->caps); + } + if (cg_flags == LXC_AUTO_CGROUP_NOSPEC) { + cg_flags = has_sys_admin ? LXC_AUTO_CGROUP_RW : LXC_AUTO_CGROUP_MIXED; + } else { + cg_flags = has_sys_admin ? LXC_AUTO_CGROUP_FULL_RW : LXC_AUTO_CGROUP_FULL_MIXED; + } + } + + if (!cgroup_mount(conf->rootfs.mount, handler, cg_flags)) { SYSERROR("error mounting /sys/fs/cgroup"); return -1; } @@ -828,6 +861,7 @@ static int setup_dev_symlinks(const struct lxc_rootfs *rootfs) { char path[MAXPATHLEN]; int ret,i; + struct stat s; for (i = 0; i < sizeof(dev_symlinks) / sizeof(dev_symlinks[0]); i++) { @@ -835,10 +869,24 @@ static int setup_dev_symlinks(const struct lxc_rootfs *rootfs) ret = snprintf(path, sizeof(path), "%s/dev/%s", rootfs->mount, d->name); if (ret < 0 || ret >= MAXPATHLEN) return -1; + + /* + * Stat the path first. If we don't get an error + * accept it as is and don't try to create it + */ + if (!stat(path, &s)) { + continue; + } + ret = symlink(d->oldpath, path); + if (ret && errno != EEXIST) { - SYSERROR("Error creating %s", path); - return -1; + if ( errno == EROFS ) { + WARN("Warning: Read Only file system while creating %s", path); + } else { + SYSERROR("Error creating %s", path); + return -1; + } } } return 0; @@ -2145,42 +2193,63 @@ static int setup_mount_entries(const struct lxc_rootfs *rootfs, struct lxc_list return ret; } -static int setup_caps(struct lxc_list *caps) +static int parse_cap(const char *cap) +{ + char *ptr = NULL; + int i, capid = -1; + + for (i = 0; i < sizeof(caps_opt)/sizeof(caps_opt[0]); i++) { + + if (strcmp(cap, caps_opt[i].name)) + continue; + + capid = caps_opt[i].value; + break; + } + + if (capid < 0) { + /* try to see if it's numeric, so the user may specify + * capabilities that the running kernel knows about but + * we don't */ + errno = 0; + capid = strtol(cap, &ptr, 10); + if (!ptr || *ptr != '\0' || errno != 0) + /* not a valid number */ + capid = -1; + else if (capid > lxc_caps_last_cap()) + /* we have a number but it's not a valid + * capability */ + capid = -1; + } + + return capid; +} + +int in_caplist(int cap, struct lxc_list *caps) { struct lxc_list *iterator; - char *drop_entry; - char *ptr; - int i, capid; + int capid; lxc_list_for_each(iterator, caps) { + capid = parse_cap(iterator->elem); + if (capid == cap) + return 1; + } - drop_entry = iterator->elem; - - capid = -1; + return 0; +} - for (i = 0; i < sizeof(caps_opt)/sizeof(caps_opt[0]); i++) { +static int setup_caps(struct lxc_list *caps) +{ + struct lxc_list *iterator; + char *drop_entry; + int capid; - if (strcmp(drop_entry, caps_opt[i].name)) - continue; + lxc_list_for_each(iterator, caps) { - capid = caps_opt[i].value; - break; - } + drop_entry = iterator->elem; - if (capid < 0) { - /* try to see if it's numeric, so the user may specify - * capabilities that the running kernel knows about but - * we don't */ - errno = 0; - capid = strtol(drop_entry, &ptr, 10); - if (!ptr || *ptr != '\0' || errno != 0) - /* not a valid number */ - capid = -1; - else if (capid > lxc_caps_last_cap()) - /* we have a number but it's not a valid - * capability */ - capid = -1; - } + capid = parse_cap(drop_entry); if (capid < 0) { ERROR("unknown capability %s", drop_entry); @@ -2205,7 +2274,6 @@ static int dropcaps_except(struct lxc_list *caps) { struct lxc_list *iterator; char *keep_entry; - char *ptr; int i, capid; int numcaps = lxc_caps_last_cap() + 1; INFO("found %d capabilities", numcaps); @@ -2221,38 +2289,14 @@ static int dropcaps_except(struct lxc_list *caps) keep_entry = iterator->elem; - capid = -1; - - for (i = 0; i < sizeof(caps_opt)/sizeof(caps_opt[0]); i++) { - - if (strcmp(keep_entry, caps_opt[i].name)) - continue; - - capid = caps_opt[i].value; - break; - } - - if (capid < 0) { - /* try to see if it's numeric, so the user may specify - * capabilities that the running kernel knows about but - * we don't */ - capid = strtol(keep_entry, &ptr, 10); - if (!ptr || *ptr != '\0' || - capid == INT_MIN || capid == INT_MAX) - /* not a valid number */ - capid = -1; - else if (capid > lxc_caps_last_cap()) - /* we have a number but it's not a valid - * capability */ - capid = -1; - } + capid = parse_cap(keep_entry); if (capid < 0) { ERROR("unknown capability %s", keep_entry); return -1; } - DEBUG("drop capability '%s' (%d)", keep_entry, capid); + DEBUG("keep capability '%s' (%d)", keep_entry, capid); caplist[capid] = 1; } @@ -3706,26 +3750,143 @@ void tmp_proc_unmount(struct lxc_conf *lxc_conf) } } -int lxc_setup(struct lxc_handler *handler) +static void null_endofword(char *word) { - const char *name = handler->name; - struct lxc_conf *lxc_conf = handler->conf; - const char *lxcpath = handler->lxcpath; - void *data = handler->data; + while (*word && *word != ' ' && *word != '\t') + word++; + *word = '\0'; +} - if (detect_shared_rootfs()) { - if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) { - SYSERROR("Failed to make / rslave"); +/* + * skip @nfields spaces in @src + */ +static char *get_field(char *src, int nfields) +{ + char *p = src; + int i; + + for (i = 0; i < nfields; i++) { + while (*p && *p != ' ' && *p != '\t') + p++; + if (!*p) + break; + p++; + } + return p; +} + +static void remount_all_slave(void) +{ + /* walk /proc/mounts and change any shared entries to slave */ + FILE *f = fopen("/proc/self/mountinfo", "r"); + char *line = NULL; + size_t len = 0; + + if (!f) { + SYSERROR("Failed to open /proc/self/mountinfo to mark all shared"); + ERROR("Continuing container startup..."); + return; + } + + while (getline(&line, &len, f) != -1) { + char *target, *opts; + target = get_field(line, 4); + if (!target) + continue; + opts = get_field(target, 2); + if (!opts) + continue; + null_endofword(opts); + if (!strstr(opts, "shared")) + continue; + null_endofword(target); + if (mount(NULL, target, NULL, MS_SLAVE, NULL)) { + SYSERROR("Failed to make %s rslave", target); ERROR("Continuing..."); } } + fclose(f); + if (line) + free(line); +} + +/* + * This does the work of remounting / if it is shared, calling the + * container pre-mount hooks, and mounting the rootfs. + */ +int do_rootfs_setup(struct lxc_conf *conf, const char *name, const char *lxcpath) +{ + if (conf->rootfs_setup) { + /* + * rootfs was set up in another namespace. bind-mount it + * to give us a mount in our own ns so we can pivot_root to it + */ + const char *path = conf->rootfs.mount; + if (mount(path, path, "rootfs", MS_BIND, NULL) < 0) { + ERROR("Failed to bind-mount container / onto itself"); + return false; + } + } + if (detect_ramfs_rootfs()) { - if (chroot_into_slave(lxc_conf)) { + if (chroot_into_slave(conf)) { ERROR("Failed to chroot into slave /"); return -1; } } + remount_all_slave(); + + if (run_lxc_hooks(name, "pre-mount", conf, lxcpath, NULL)) { + ERROR("failed to run pre-mount hooks for container '%s'.", name); + return -1; + } + + if (setup_rootfs(conf)) { + ERROR("failed to setup rootfs for '%s'", name); + return -1; + } + + conf->rootfs_setup = true; + return 0; +} + +static bool verify_start_hooks(struct lxc_conf *conf) +{ + struct lxc_list *it; + char path[MAXPATHLEN]; + lxc_list_for_each(it, &conf->hooks[LXCHOOK_START]) { + char *hookname = it->elem; + struct stat st; + int ret; + + ret = snprintf(path, MAXPATHLEN, "%s%s", + conf->rootfs.mount, hookname); + if (ret < 0 || ret >= MAXPATHLEN) + return false; + ret = stat(path, &st); + if (ret) { + SYSERROR("Start hook %s not found in container rootfs", + hookname); + return false; + } + } + + return true; +} + +int lxc_setup(struct lxc_handler *handler) +{ + const char *name = handler->name; + struct lxc_conf *lxc_conf = handler->conf; + const char *lxcpath = handler->lxcpath; + void *data = handler->data; + + if (do_rootfs_setup(lxc_conf, name, lxcpath) < 0) { + ERROR("Error setting up rootfs mount after spawn"); + return -1; + } + if (lxc_conf->inherit_ns_fd[LXC_NS_UTS] == -1) { if (setup_utsname(lxc_conf->utsname)) { ERROR("failed to setup the utsname for '%s'", name); @@ -3738,16 +3899,6 @@ int lxc_setup(struct lxc_handler *handler) return -1; } - if (run_lxc_hooks(name, "pre-mount", lxc_conf, lxcpath, NULL)) { - ERROR("failed to run pre-mount hooks for container '%s'.", name); - return -1; - } - - if (setup_rootfs(lxc_conf)) { - ERROR("failed to setup rootfs for '%s'", name); - return -1; - } - if (lxc_conf->autodev < 0) { lxc_conf->autodev = check_autodev(lxc_conf->rootfs.mount, data); } @@ -3777,6 +3928,10 @@ int lxc_setup(struct lxc_handler *handler) return -1; } + /* Make sure any start hooks are in the rootfs */ + if (!verify_start_hooks(lxc_conf)) + return -1; + /* now mount only cgroup, if wanted; * before, /sys could not have been mounted * (is either mounted automatically or via fstab entries) diff --git a/src/lxc/conf.h b/src/lxc/conf.h index c3705873ce..f5fab3d842 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _conf_h -#define _conf_h +#ifndef __LXC_CONF_H +#define __LXC_CONF_H #include "config.h" @@ -240,9 +240,16 @@ enum { LXC_AUTO_CGROUP_FULL_RO = 0x040, /* /sys/fs/cgroup (full mount, read-only) */ LXC_AUTO_CGROUP_FULL_RW = 0x050, /* /sys/fs/cgroup (full mount, read-write) */ LXC_AUTO_CGROUP_FULL_MIXED = 0x060, /* /sys/fs/cgroup (full mount, parent r/o, own r/w) */ - LXC_AUTO_CGROUP_MASK = 0x070, - - LXC_AUTO_ALL_MASK = 0x07F, /* all known settings */ + /* These are defined in such a way as to retain + * binary compatibility with earlier versions of + * this code. If the previous mask is applied, + * both of these will default back to the _MIXED + * variants, which is safe. */ + LXC_AUTO_CGROUP_NOSPEC = 0x0B0, /* /sys/fs/cgroup (partial mount, r/w or mixed, depending on caps) */ + LXC_AUTO_CGROUP_FULL_NOSPEC = 0x0E0, /* /sys/fs/cgroup (full mount, r/w or mixed, depending on caps) */ + LXC_AUTO_CGROUP_MASK = 0x0F0, + + LXC_AUTO_ALL_MASK = 0x0FF, /* all known settings */ }; /* @@ -281,7 +288,7 @@ struct lxc_conf { int pts; int reboot; int need_utmp_watch; - int personality; + signed long personality; struct utsname *utsname; struct lxc_list cgroup; struct lxc_list id_map; @@ -327,6 +334,10 @@ struct lxc_conf { int start_delay; int start_order; struct lxc_list groups; + int nbd_idx; + + /* set to true when rootfs has been setup */ + bool rootfs_setup; }; int run_lxc_hooks(const char *name, char *hook, struct lxc_conf *conf, @@ -363,6 +374,9 @@ extern int lxc_clear_hooks(struct lxc_conf *c, const char *key); extern int lxc_clear_idmaps(struct lxc_conf *c); extern int lxc_clear_groups(struct lxc_conf *c); +extern int do_rootfs_setup(struct lxc_conf *conf, const char *name, + const char *lxcpath); + /* * Configure the container from inside */ diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 90fb34400f..47b285e30c 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1165,7 +1165,7 @@ static const char *sig_name(int signum) { int n; for (n = 0; n < sizeof(signames) / sizeof((signames)[0]); n++) { - if (n == signames[n].num) + if (signum == signames[n].num) return signames[n].name; } return ""; @@ -1347,20 +1347,20 @@ static int config_mount_auto(const char *key, const char *value, { char *autos, *autoptr, *sptr, *token; static struct { const char *token; int mask; int flag; } allowed_auto_mounts[] = { - { "proc", LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED }, - { "proc:mixed", LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED }, - { "proc:rw", LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_RW }, - { "sys", LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RO }, - { "sys:ro", LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RO }, - { "sys:rw", LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RW }, - { "cgroup", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_MIXED }, - { "cgroup:mixed", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_MIXED }, - { "cgroup:ro", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_RO }, - { "cgroup:rw", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_RW }, - { "cgroup-full", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_MIXED }, - { "cgroup-full:mixed", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_MIXED }, - { "cgroup-full:ro", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_RO }, - { "cgroup-full:rw", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_RW }, + { "proc", LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED }, + { "proc:mixed", LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED }, + { "proc:rw", LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_RW }, + { "sys", LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RO }, + { "sys:ro", LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RO }, + { "sys:rw", LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RW }, + { "cgroup", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_NOSPEC }, + { "cgroup:mixed", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_MIXED }, + { "cgroup:ro", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_RO }, + { "cgroup:rw", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_RW }, + { "cgroup-full", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_NOSPEC }, + { "cgroup-full:mixed", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_MIXED }, + { "cgroup-full:ro", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_RO }, + { "cgroup-full:rw", LXC_AUTO_CGROUP_MASK, LXC_AUTO_CGROUP_FULL_RW }, /* NB: For adding anything that ist just a single on/off, but has * no options: keep mask and flag identical and just define the * enum value as an unused bit so far @@ -1723,9 +1723,15 @@ signed long lxc_config_parse_arch(const char *arch) struct per_name { char *name; unsigned long per; - } pername[4] = { + } pername[] = { { "x86", PER_LINUX32 }, + { "linux32", PER_LINUX32 }, + { "i386", PER_LINUX32 }, + { "i486", PER_LINUX32 }, + { "i586", PER_LINUX32 }, { "i686", PER_LINUX32 }, + { "athlon", PER_LINUX32 }, + { "linux64", PER_LINUX }, { "x86_64", PER_LINUX }, { "amd64", PER_LINUX }, }; @@ -1948,6 +1954,7 @@ static int lxc_get_mount_entries(struct lxc_conf *c, char *retv, int inlen) static int lxc_get_auto_mounts(struct lxc_conf *c, char *retv, int inlen) { int len, fulllen = 0; + const char *sep = ""; if (!retv) inlen = 0; @@ -1958,24 +1965,27 @@ static int lxc_get_auto_mounts(struct lxc_conf *c, char *retv, int inlen) return 0; switch (c->auto_mounts & LXC_AUTO_PROC_MASK) { - case LXC_AUTO_PROC_MIXED: strprint(retv, inlen, "proc:mixed\n"); break; - case LXC_AUTO_PROC_RW: strprint(retv, inlen, "proc:rw"); break; + case LXC_AUTO_PROC_MIXED: strprint(retv, inlen, "%sproc:mixed", sep); sep = " "; break; + case LXC_AUTO_PROC_RW: strprint(retv, inlen, "%sproc:rw", sep); sep = " "; break; default: break; } switch (c->auto_mounts & LXC_AUTO_SYS_MASK) { - case LXC_AUTO_SYS_RO: strprint(retv, inlen, "sys:ro"); break; - case LXC_AUTO_SYS_RW: strprint(retv, inlen, "sys:rw"); break; + case LXC_AUTO_SYS_RO: strprint(retv, inlen, "%ssys:ro", sep); sep = " "; break; + case LXC_AUTO_SYS_RW: strprint(retv, inlen, "%ssys:rw", sep); sep = " "; break; default: break; } switch (c->auto_mounts & LXC_AUTO_CGROUP_MASK) { - case LXC_AUTO_CGROUP_MIXED: strprint(retv, inlen, "cgroup:mixed"); break; - case LXC_AUTO_CGROUP_RO: strprint(retv, inlen, "cgroup:ro"); break; - case LXC_AUTO_CGROUP_RW: strprint(retv, inlen, "cgroup:rw"); break; - case LXC_AUTO_CGROUP_FULL_MIXED: strprint(retv, inlen, "cgroup-full:mixed"); break; - case LXC_AUTO_CGROUP_FULL_RO: strprint(retv, inlen, "cgroup-full:ro"); break; - case LXC_AUTO_CGROUP_FULL_RW: strprint(retv, inlen, "cgroup-full:rw"); break; + case LXC_AUTO_CGROUP_NOSPEC: strprint(retv, inlen, "%scgroup", sep); sep = " "; break; + case LXC_AUTO_CGROUP_MIXED: strprint(retv, inlen, "%scgroup:mixed", sep); sep = " "; break; + case LXC_AUTO_CGROUP_RO: strprint(retv, inlen, "%scgroup:ro", sep); sep = " "; break; + case LXC_AUTO_CGROUP_RW: strprint(retv, inlen, "%scgroup:rw", sep); sep = " "; break; + case LXC_AUTO_CGROUP_FULL_NOSPEC: strprint(retv, inlen, "%scgroup-full", sep); sep = " "; break; + case LXC_AUTO_CGROUP_FULL_MIXED: strprint(retv, inlen, "%scgroup-full:mixed", sep); sep = " "; break; + case LXC_AUTO_CGROUP_FULL_RO: strprint(retv, inlen, "%scgroup-full:ro", sep); sep = " "; break; + case LXC_AUTO_CGROUP_FULL_RW: strprint(retv, inlen, "%scgroup-full:rw", sep); sep = " "; break; default: break; } + return fulllen; } @@ -2221,22 +2231,24 @@ void write_config(FILE *fout, struct lxc_conf *c) if (c->auto_mounts & LXC_AUTO_ALL_MASK) { fprintf(fout, "lxc.mount.auto ="); switch (c->auto_mounts & LXC_AUTO_PROC_MASK) { - case LXC_AUTO_PROC_MIXED: fprintf(fout, " proc:mixed"); break; - case LXC_AUTO_PROC_RW: fprintf(fout, " proc:rw"); break; + case LXC_AUTO_PROC_MIXED: fprintf(fout, " proc:mixed"); break; + case LXC_AUTO_PROC_RW: fprintf(fout, " proc:rw"); break; default: break; } switch (c->auto_mounts & LXC_AUTO_SYS_MASK) { - case LXC_AUTO_SYS_RO: fprintf(fout, " sys:ro"); break; - case LXC_AUTO_SYS_RW: fprintf(fout, " sys:rw"); break; + case LXC_AUTO_SYS_RO: fprintf(fout, " sys:ro"); break; + case LXC_AUTO_SYS_RW: fprintf(fout, " sys:rw"); break; default: break; } switch (c->auto_mounts & LXC_AUTO_CGROUP_MASK) { - case LXC_AUTO_CGROUP_MIXED: fprintf(fout, " cgroup:mixed"); break; - case LXC_AUTO_CGROUP_RO: fprintf(fout, " cgroup:ro"); break; - case LXC_AUTO_CGROUP_RW: fprintf(fout, " cgroup:rw"); break; - case LXC_AUTO_CGROUP_FULL_MIXED: fprintf(fout, " cgroup-full:mixed"); break; - case LXC_AUTO_CGROUP_FULL_RO: fprintf(fout, " cgroup-full:ro"); break; - case LXC_AUTO_CGROUP_FULL_RW: fprintf(fout, " cgroup-full:rw"); break; + case LXC_AUTO_CGROUP_NOSPEC: fprintf(fout, " cgroup"); break; + case LXC_AUTO_CGROUP_MIXED: fprintf(fout, " cgroup:mixed"); break; + case LXC_AUTO_CGROUP_RO: fprintf(fout, " cgroup:ro"); break; + case LXC_AUTO_CGROUP_RW: fprintf(fout, " cgroup:rw"); break; + case LXC_AUTO_CGROUP_FULL_NOSPEC: fprintf(fout, " cgroup-full"); break; + case LXC_AUTO_CGROUP_FULL_MIXED: fprintf(fout, " cgroup-full:mixed"); break; + case LXC_AUTO_CGROUP_FULL_RO: fprintf(fout, " cgroup-full:ro"); break; + case LXC_AUTO_CGROUP_FULL_RW: fprintf(fout, " cgroup-full:rw"); break; default: break; } fprintf(fout, "\n"); diff --git a/src/lxc/confile.h b/src/lxc/confile.h index 38f04f6604..171614a91e 100644 --- a/src/lxc/confile.h +++ b/src/lxc/confile.h @@ -21,12 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef __LXC_CONFILE_H +#define __LXC_CONFILE_H + #include #include -#ifndef _confile_h -#define _confile_h - struct lxc_conf; struct lxc_list; diff --git a/src/lxc/console.h b/src/lxc/console.h index eb3894b34a..41d53e6264 100644 --- a/src/lxc/console.h +++ b/src/lxc/console.h @@ -21,6 +21,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef __LXC_CONSOLE_H +#define __LXC_CONSOLE_H + struct lxc_epoll_descr; struct lxc_container; @@ -37,3 +40,5 @@ extern int lxc_console(struct lxc_container *c, int ttynum, extern int lxc_console_getfd(struct lxc_container *c, int *ttynum, int *masterfd); extern int lxc_console_set_stdfds(struct lxc_handler *); + +#endif diff --git a/src/lxc/error.h b/src/lxc/error.h index 61033d30cd..d5d60de0f0 100644 --- a/src/lxc/error.h +++ b/src/lxc/error.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __lxc_error_h -#define __lxc_error_h +#ifndef __LXC_ERROR_H +#define __LXC_ERROR_H extern int lxc_error_set_and_log(int pid, int status); diff --git a/src/lxc/genl.h b/src/lxc/genl.h index 20b673b501..30806186ff 100644 --- a/src/lxc/genl.h +++ b/src/lxc/genl.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __genl_h -#define __genl_h +#ifndef __LXC_GENL_H +#define __LXC_GENL_H /* * Use this as a good size to allocate generic netlink messages diff --git a/src/lxc/list.h b/src/lxc/list.h index 8714fb3bba..0882da05ff 100644 --- a/src/lxc/list.h +++ b/src/lxc/list.h @@ -21,8 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _list_h -#define _list_h +#ifndef __LXC_LIST_H +#define __LXC_LIST_H struct lxc_list { void *elem; diff --git a/src/lxc/log.h b/src/lxc/log.h index 5252869a67..b47f1209f9 100644 --- a/src/lxc/log.h +++ b/src/lxc/log.h @@ -21,8 +21,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _log_h -#define _log_h +#ifndef __LXC_LOG_H +#define __LXC_LOG_H #include "config.h" @@ -44,6 +44,13 @@ #define LXC_LOG_PREFIX_SIZE 32 #define LXC_LOG_BUFFER_SIZE 512 +/* This attribute is required to silence clang warnings */ +#if defined(__GNUC__) +#define ATTR_UNUSED __attribute__ ((unused)) +#else +#define ATTR_UNUSED +#endif + /* predefined priorities. */ enum lxc_loglevel { LXC_LOG_PRIORITY_TRACE, @@ -180,10 +187,10 @@ __lxc_log(const struct lxc_log_category* category, */ #define lxc_log_priority_define(acategory, PRIORITY) \ \ -static inline void LXC_##PRIORITY(struct lxc_log_locinfo *, \ +ATTR_UNUSED static inline void LXC_##PRIORITY(struct lxc_log_locinfo *, \ const char *, ...) __attribute__ ((format (printf, 2, 3))); \ \ -static inline void LXC_##PRIORITY(struct lxc_log_locinfo* locinfo, \ +ATTR_UNUSED static inline void LXC_##PRIORITY(struct lxc_log_locinfo* locinfo, \ const char* format, ...) \ { \ if (lxc_log_priority_is_enabled(acategory, \ diff --git a/src/lxc/lxc-ls b/src/lxc/lxc-ls index 5d70e1f4bc..5c3e9b52c4 100644 --- a/src/lxc/lxc-ls +++ b/src/lxc/lxc-ls @@ -38,6 +38,10 @@ import sys _ = gettext.gettext gettext.textdomain("lxc-ls") +# Required for containers without python +import encodings.ascii +assert encodings.ascii + # Constants LXCPATH = "/usr/local/var/lib/lxc" RUNTIME_PATH = "/run" diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in index fa387b3cf3..fe22528473 100755 --- a/src/lxc/lxc-ls.in +++ b/src/lxc/lxc-ls.in @@ -38,6 +38,10 @@ import sys _ = gettext.gettext gettext.textdomain("lxc-ls") +# Required for containers without python +import encodings.ascii +assert encodings.ascii + # Constants LXCPATH = "@LXCPATH@" RUNTIME_PATH = "@RUNTIME_PATH@" diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index 8775640535..e340382eeb 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __lxc_h -#define __lxc_h +#ifndef __LXC_LXC_H +#define __LXC_LXC_H #ifdef __cplusplus extern "C" { diff --git a/src/lxc/lxc_autostart.c b/src/lxc/lxc_autostart.c index cfb24d068b..2b553982ea 100644 --- a/src/lxc/lxc_autostart.c +++ b/src/lxc/lxc_autostart.c @@ -28,6 +28,9 @@ #include "log.h" lxc_log_define(lxc_autostart_ui, lxc); +static struct lxc_list *accumulate_list(char *input, char *delimiter, struct lxc_list *str_list); + +struct lxc_list *cmd_groups_list = NULL; static int my_parser(struct lxc_arguments* args, int c, char* arg) { @@ -37,7 +40,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg) case 'r': args->reboot = 1; break; case 's': args->shutdown = 1; break; case 'a': args->all = 1; break; - case 'g': args->groups = arg; break; + case 'g': cmd_groups_list = accumulate_list( arg, ",", cmd_groups_list); break; case 't': args->timeout = atoi(arg); break; } return 0; @@ -76,6 +79,29 @@ Options:\n\ .timeout = 60, }; +int list_contains_entry( char *str_ptr, struct lxc_list *p1 ) { + struct lxc_list *it1; + + /* + * If the entry is NULL or the empty string and the list + * is NULL, we have a match + */ + if (! p1 && ! str_ptr) + return 1; + if (! p1 && ! *str_ptr) + return 1; + + if (!p1) + return 0; + + lxc_list_for_each(it1, p1) { + if (strcmp(it1->elem, str_ptr) == 0) + return 1; + } + + return 0; +} + int lists_contain_common_entry(struct lxc_list *p1, struct lxc_list *p2) { struct lxc_list *it1; struct lxc_list *it2; @@ -99,6 +125,78 @@ int lists_contain_common_entry(struct lxc_list *p1, struct lxc_list *p2) { return 0; } +/* + * This is a variation of get_list below it. + * This version allows two additional features. + * If a list is passed to it, it adds to it. + * It allows for empty entries (i.e. "group1,,group2") generating + * and empty list entry. + */ +static struct lxc_list *accumulate_list(char *input, char *delimiter, struct lxc_list *str_list) { + char *workstr = NULL; + char *workptr = NULL; + char *next_ptr = NULL; + struct lxc_list *worklist; + struct lxc_list *workstr_list; + + workstr = strdup(input); + if (!workstr) { + return NULL; + } + + workstr_list = str_list; + if ( ! workstr_list ) { + workstr_list = malloc(sizeof(*workstr_list)); + lxc_list_init(workstr_list); + } + + for (workptr = workstr; workptr; workptr = next_ptr) { + /* + * We can't use strtok_r here because it collapses + * multiple delimiters into 1 making empty fields + * impossible... + */ + /* token = strtok_r(workptr, delimiter, &sptr); */ + next_ptr = strchr( workptr, *delimiter ); + + if( next_ptr ) { + *next_ptr++ = '\0'; + } + + /* + * At this point, we'd like to check to see if this + * group is already contained in the list and ignore + * it if it is... This also helps us with any + * corner cases where a string begins or ends with a + * delimiter. + */ + + if ( list_contains_entry( workptr, workstr_list ) ) { + if ( *workptr ) { + fprintf(stderr, "Duplicate group \"%s\" in list - ignoring\n", workptr ); + } else { + fprintf(stderr, "Duilicate NULL group in list - ignoring\n" ); + } + } else { + worklist = malloc(sizeof(*worklist)); + if (!worklist) + break; + + worklist->elem = strdup(workptr); + if (!worklist->elem) { + free(worklist); + break; + } + + lxc_list_add_tail(workstr_list, worklist); + } + } + + free(workstr); + + return workstr_list; +} + static struct lxc_list *get_list(char *input, char *delimiter) { char *workstr = NULL; char *workptr = NULL; @@ -206,18 +304,32 @@ static int cmporder(const void *p1, const void *p2) { return (c1_order - c2_order) * -1; } +static int toss_list( struct lxc_list *c_groups_list ) { + struct lxc_list *it, *next; + + if (c_groups_list) { + lxc_list_for_each_safe(it, c_groups_list, next) { + lxc_list_del(it); + free(it->elem); + free(it); + } + free(c_groups_list); + } + + return 1; +} + int main(int argc, char *argv[]) { int count = 0; int i = 0; int ret = 0; struct lxc_container **containers = NULL; - struct lxc_list *cmd_groups_list = NULL; - struct lxc_list *c_groups_list = NULL; - struct lxc_list *it, *next; + struct lxc_list **c_groups_lists = NULL; + struct lxc_list *cmd_group; char *const default_start_args[] = { "/sbin/init", - '\0', + NULL, }; if (lxc_arguments_parse(&my_args, argc, argv)) @@ -233,112 +345,165 @@ int main(int argc, char *argv[]) if (count < 0) return 1; - qsort(&containers[0], count, sizeof(struct lxc_container *), cmporder); + if (!my_args.all) { + /* Allocate an array for our container group lists */ + c_groups_lists = calloc( count, sizeof( struct lxc_list * ) ); + } - if (my_args.groups && !my_args.all) - cmd_groups_list = get_list((char*)my_args.groups, ","); + qsort(&containers[0], count, sizeof(struct lxc_container *), cmporder); - for (i = 0; i < count; i++) { - struct lxc_container *c = containers[i]; + if (cmd_groups_list && my_args.all) { + fprintf(stderr, "Specifying -a (all) with -g (groups) doesn't make sense. All option overrides."); + } - if (!c->may_control(c)) { - lxc_container_put(c); - continue; - } + if (!cmd_groups_list) { + /* + * We need a default cmd_groups_list even for the -a + * case in order to force a pass through the loop for + * the NULL group. This, someday, could be taken from + * a config file somewhere... + */ + cmd_groups_list = accumulate_list( "" , ",", NULL ); + } - if (get_config_integer(c, "lxc.start.auto") != 1) { - lxc_container_put(c); - continue; - } + lxc_list_for_each(cmd_group, cmd_groups_list) { - if (!my_args.all) { - /* Filter by group */ - c_groups_list = get_config_list(c, "lxc.group"); + /* + * Prograpmmers Note: + * Because we may take several passes through the container list + * We'll switch on if the container pointer is NULL and if we process a + * container (run it or decide to ignore it) and call lxc_container_put + * then we'll NULL it out and not check it again. + */ + for (i = 0; i < count; i++) { + struct lxc_container *c = containers[i]; - ret = lists_contain_common_entry(cmd_groups_list, c_groups_list); + if (!c) + /* Skip - must have been already processed */ + continue; - if (c_groups_list) { - lxc_list_for_each_safe(it, c_groups_list, next) { - lxc_list_del(it); - free(it->elem); - free(it); - } - free(c_groups_list); + /* + * We haven't loaded the container groups yet so + * these next two checks don't need to free them + * if they fail. They'll fail on the first pass. + */ + if (!c->may_control(c)) { + /* We're done with this container */ + if ( lxc_container_put(c) > 0 ) + containers[i] = NULL; + continue; } - if (ret == 0) { - lxc_container_put(c); + if (get_config_integer(c, "lxc.start.auto") != 1) { + /* We're done with this container */ + if ( lxc_container_put(c) > 0 ) + containers[i] = NULL; continue; } - } - c->want_daemonize(c, 1); - - if (my_args.shutdown) { - /* Shutdown the container */ - if (c->is_running(c)) { - if (my_args.list) - printf("%s\n", c->name); - else { - if (!c->shutdown(c, my_args.timeout)) { - if (!c->stop(c)) { - fprintf(stderr, "Error shutting down container: %s\n", c->name); + if (!my_args.all) { + /* Filter by group */ + if( ! c_groups_lists[i] ) { + /* Now we're loading up a container's groups */ + c_groups_lists[i] = get_config_list(c, "lxc.group"); + } + + ret = list_contains_entry(cmd_group->elem, c_groups_lists[i]); + + if ( ret == 0 ) { + /* Not in the target group this pass */ + /* Leave in the list for subsequent passes */ + continue; + } + } + + /* We have a candidate continer to process */ + c->want_daemonize(c, 1); + + if (my_args.shutdown) { + /* Shutdown the container */ + if (c->is_running(c)) { + if (my_args.list) + printf("%s\n", c->name); + else { + if (!c->shutdown(c, my_args.timeout)) { + if (!c->stop(c)) { + fprintf(stderr, "Error shutting down container: %s\n", c->name); + } } } } } - } - else if (my_args.hardstop) { - /* Kill the container */ - if (c->is_running(c)) { - if (my_args.list) - printf("%s\n", c->name); - else { - if (!c->stop(c)) - fprintf(stderr, "Error killing container: %s\n", c->name); + else if (my_args.hardstop) { + /* Kill the container */ + if (c->is_running(c)) { + if (my_args.list) + printf("%s\n", c->name); + else { + if (!c->stop(c)) + fprintf(stderr, "Error killing container: %s\n", c->name); + } } } - } - else if (my_args.reboot) { - /* Reboot the container */ - if (c->is_running(c)) { - if (my_args.list) - printf("%s %d\n", c->name, - get_config_integer(c, "lxc.start.delay")); - else { - if (!c->reboot(c)) - fprintf(stderr, "Error rebooting container: %s\n", c->name); - else - sleep(get_config_integer(c, "lxc.start.delay")); + else if (my_args.reboot) { + /* Reboot the container */ + if (c->is_running(c)) { + if (my_args.list) + printf("%s %d\n", c->name, + get_config_integer(c, "lxc.start.delay")); + else { + if (!c->reboot(c)) + fprintf(stderr, "Error rebooting container: %s\n", c->name); + else + sleep(get_config_integer(c, "lxc.start.delay")); + } } } - } - else { - /* Start the container */ - if (!c->is_running(c)) { - if (my_args.list) - printf("%s %d\n", c->name, - get_config_integer(c, "lxc.start.delay")); - else { - if (!c->start(c, 0, default_start_args)) - fprintf(stderr, "Error starting container: %s\n", c->name); - else - sleep(get_config_integer(c, "lxc.start.delay")); + else { + /* Start the container */ + if (!c->is_running(c)) { + if (my_args.list) + printf("%s %d\n", c->name, + get_config_integer(c, "lxc.start.delay")); + else { + if (!c->start(c, 0, default_start_args)) + fprintf(stderr, "Error starting container: %s\n", c->name); + else + sleep(get_config_integer(c, "lxc.start.delay")); + } } } - } - - lxc_container_put(c); + /* + * If we get this far and we haven't hit any skip "continue" + * then we're done with this container... We can dump any + * c_groups_list and the container itself. + */ + if ( lxc_container_put(c) > 0 ) { + containers[i] = NULL; + } + if ( c_groups_lists && c_groups_lists[i] ) { + toss_list(c_groups_lists[i]); + c_groups_lists[i] = NULL; + } + } } - if (cmd_groups_list) { - lxc_list_for_each_safe(it, cmd_groups_list, next) { - lxc_list_del(it); - free(it->elem); - free(it); + /* clean up any lingering detritus */ + for (i = 0; i < count; i++) { + if ( containers[i] ) { + lxc_container_put(containers[i]); + } + if ( c_groups_lists && c_groups_lists[i] ) { + toss_list(c_groups_lists[i]); } - free(cmd_groups_list); + } + + if ( c_groups_lists ) + free(c_groups_lists); + + if ( cmd_groups_list ) { + toss_list( cmd_groups_list ); } free(containers); diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c index eee6ffd798..d49704635e 100644 --- a/src/lxc/lxc_create.c +++ b/src/lxc/lxc_create.c @@ -209,6 +209,9 @@ int main(int argc, char *argv[]) if (!validate_bdev_args(&my_args)) exit(1); + if (strcmp(my_args.bdevtype, "none") == 0) + my_args.bdevtype = "dir"; + if (geteuid()) { if (mkdir_p(my_args.lxcpath[0], 0755)) { exit(1); @@ -217,8 +220,9 @@ int main(int argc, char *argv[]) fprintf(stderr, "You lack access to %s\n", my_args.lxcpath[0]); exit(1); } - if (strcmp(my_args.bdevtype, "dir") && strcmp(my_args.bdevtype, "_unset")) { - fprintf(stderr, "Unprivileged users can only create directory backed containers\n"); + if (strcmp(my_args.bdevtype, "dir") && strcmp(my_args.bdevtype, "_unset") && + strcmp(my_args.bdevtype, "btrfs")) { + fprintf(stderr, "Unprivileged users cannot create %s containers", my_args.bdevtype); exit(1); } } diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c index df25df3f8b..6949e2b84a 100644 --- a/src/lxc/lxc_execute.c +++ b/src/lxc/lxc_execute.c @@ -140,6 +140,9 @@ int main(int argc, char *argv[]) return 1; ret = lxc_execute(my_args.name, my_args.argv, my_args.quiet, conf, my_args.lxcpath[0]); + + lxc_conf_free(conf); + if (ret < 0) return 1; return ret; diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c index 24d6f9bd9b..e1e39c06ad 100644 --- a/src/lxc/lxc_info.c +++ b/src/lxc/lxc_info.c @@ -50,9 +50,13 @@ static int filter_count = 0; static int my_parser(struct lxc_arguments* args, int c, char* arg) { + char **newk; switch (c) { case 'c': - key = realloc(key, keys+1 * sizeof(key[0])); + newk = realloc(key, keys+1 * sizeof(key[0])); + if (!newk) + return -1; + key = newk; key[keys] = arg; keys++; break; diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c index 157bea924b..1d8145fcd1 100644 --- a/src/lxc/lxc_start.c +++ b/src/lxc/lxc_start.c @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) char *rcfile = NULL; char *const default_args[] = { "/sbin/init", - '\0', + NULL, }; struct lxc_container *c; @@ -329,8 +329,16 @@ int main(int argc, char *argv[]) c->want_close_all_fds(c, true); err = c->start(c, 0, args) ? 0 : 1; + + if (err) { + ERROR("The container failed to start."); + if (my_args.daemonize) + ERROR("To get more details, run the container in foreground mode."); + ERROR("Additional information can be obtained by setting the " + "--logfile and --log-priority options."); + } + out: lxc_container_put(c); return err; } - diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c index 0e665495b9..1105b3d0ea 100644 --- a/src/lxc/lxc_user_nic.c +++ b/src/lxc/lxc_user_nic.c @@ -286,13 +286,16 @@ static bool create_nic(char *nic, char *br, int pid, char **cnic) * *dest will container the name (vethXXXXXX) which is attached * on the host to the lxc bridge */ -static void get_new_nicname(char **dest, char *br, int pid, char **cnic) +static bool get_new_nicname(char **dest, char *br, int pid, char **cnic) { char template[IFNAMSIZ]; snprintf(template, sizeof(template), "vethXXXXXX"); *dest = lxc_mkifname(template); - create_nic(*dest, br, pid, cnic); + if (!create_nic(*dest, br, pid, cnic)) { + return false; + } + return true; } static bool get_nic_from_line(char *p, char **nic) @@ -419,7 +422,8 @@ static bool get_nic_if_avail(int fd, char *me, int pid, char *intype, char *br, return false; } - get_new_nicname(nicname, br, pid, cnic); + if (!get_new_nicname(nicname, br, pid, cnic)) + return false; /* me ' ' intype ' ' br ' ' *nicname + '\n' + '\0' */ slen = strlen(me) + strlen(intype) + strlen(br) + strlen(*nicname) + 5; newline = alloca(slen); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index c90b564f8b..62e38d7a24 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -555,7 +555,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv FILE *pid_fp = NULL; char *default_args[] = { "/sbin/init", - '\0', + NULL, }; /* container exists */ @@ -918,9 +918,9 @@ static bool create_run_template(struct lxc_container *c, char *tpath, bool quiet } } } - if (strcmp(bdev->type, "dir") != 0) { + if (strcmp(bdev->type, "dir") && strcmp(bdev->type, "btrfs")) { if (geteuid() != 0) { - ERROR("non-root users can only create directory-backed containers"); + ERROR("non-root users can only create btrfs and directory-backed containers"); exit(1); } if (bdev->ops->mount(bdev) < 0) { @@ -1177,7 +1177,7 @@ static bool prepend_lxc_header(char *path, const char *t, char *const argv[]) fprintf(f, "%02x", md_value[i]); fprintf(f, "\n"); #endif - fprintf(f, "# For additional config options, please look at lxc.conf(5)\n"); + fprintf(f, "# For additional config options, please look at lxc.container.conf(5)\n"); if (fwrite(contents, 1, flen, f) != flen) { SYSERROR("Writing original contents"); free(contents); @@ -1987,10 +1987,41 @@ static int lxc_rmdir_onedev_wrapper(void *data) return lxc_rmdir_onedev(arg); } +static int do_bdev_destroy(struct lxc_conf *conf) +{ + struct bdev *r; + int ret = 0; + + r = bdev_init(conf->rootfs.path, conf->rootfs.mount, NULL); + if (!r) + return -1; + + if (r->ops->destroy(r) < 0) + ret = -1; + bdev_put(r); + return ret; +} + +static int bdev_destroy_wrapper(void *data) +{ + struct lxc_conf *conf = data; + + if (setgid(0) < 0) { + ERROR("Failed to setgid to 0"); + return -1; + } + if (setgroups(0, NULL) < 0) + WARN("Failed to clear groups"); + if (setuid(0) < 0) { + ERROR("Failed to setuid to 0"); + return -1; + } + return do_bdev_destroy(conf); +} + // do we want the api to support --force, or leave that to the caller? static bool lxcapi_destroy(struct lxc_container *c) { - struct bdev *r = NULL; bool bret = false; int ret; @@ -2011,15 +2042,14 @@ static bool lxcapi_destroy(struct lxc_container *c) goto out; } - if (!am_unpriv() && c->lxc_conf && c->lxc_conf->rootfs.path && c->lxc_conf->rootfs.mount) { - r = bdev_init(c->lxc_conf->rootfs.path, c->lxc_conf->rootfs.mount, NULL); - if (r) { - if (r->ops->destroy(r) < 0) { - bdev_put(r); - ERROR("Error destroying rootfs for %s", c->name); - goto out; - } - bdev_put(r); + if (c->lxc_conf && c->lxc_conf->rootfs.path && c->lxc_conf->rootfs.mount) { + if (am_unpriv()) + ret = userns_exec_1(c->lxc_conf, bdev_destroy_wrapper, c->lxc_conf); + else + ret = do_bdev_destroy(c->lxc_conf); + if (ret < 0) { + ERROR("Error destroying rootfs for %s", c->name); + goto out; } } @@ -2829,6 +2859,9 @@ static int lxcapi_snapshot(struct lxc_container *c, const char *commentfile) struct lxc_container *c2; char snappath[MAXPATHLEN], newname[20]; + if (!c || !lxcapi_is_defined(c)) + return -1; + // /var/lib/lxc -> /var/lib/lxcsnaps \0 ret = snprintf(snappath, MAXPATHLEN, "%ssnaps/%s", c->config_path, c->name); if (ret < 0 || ret >= MAXPATHLEN) @@ -3060,13 +3093,7 @@ static bool lxcapi_snapshot_restore(struct lxc_container *c, const char *snapnam if (!newname) newname = c->name; - if (strcmp(c->name, newname) == 0) { - if (!lxcapi_destroy(c)) { - ERROR("Could not destroy existing container %s", newname); - bdev_put(bdev); - return false; - } - } + ret = snprintf(clonelxcpath, MAXPATHLEN, "%ssnaps/%s", c->config_path, c->name); if (ret < 0 || ret >= MAXPATHLEN) { bdev_put(bdev); @@ -3082,6 +3109,15 @@ static bool lxcapi_snapshot_restore(struct lxc_container *c, const char *snapnam return false; } + if (strcmp(c->name, newname) == 0) { + if (!lxcapi_destroy(c)) { + ERROR("Could not destroy existing container %s", newname); + lxc_container_put(snap); + bdev_put(bdev); + return false; + } + } + if (strcmp(bdev->type, "dir") != 0 && strcmp(bdev->type, "loop") != 0) flags = LXC_CLONE_SNAPSHOT | LXC_CLONE_MAYBE_SNAPSHOT; rest = lxcapi_clone(snap, newname, c->config_path, flags, diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h index ba15ab78a2..1d0628af83 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -758,6 +758,24 @@ struct lxc_snapshot { void (*free)(struct lxc_snapshot *s); }; + +/*! + * \brief Specifications for how to create a new backing store + */ +struct bdev_specs { + char *fstype; /*!< Filesystem type */ + uint64_t fssize; /*!< Filesystem size in bytes */ + struct { + char *zfsroot; /*!< ZFS root path */ + } zfs; + struct { + char *vg; /*!< LVM Volume Group name */ + char *lv; /*!< LVM Logical Volume name */ + char *thinpool; /*!< LVM thin pool to use, if any */ + } lvm; + char *dir; /*!< Directory path */ +}; + /*! * \brief Create a new container. * diff --git a/src/lxc/lxclock.c b/src/lxc/lxclock.c index b7a00786a4..1d62729361 100644 --- a/src/lxc/lxclock.c +++ b/src/lxc/lxclock.c @@ -37,6 +37,8 @@ #include #endif +#define MAX_STACKDEPTH 25 + #define OFLAG (O_CREAT | O_RDWR) #define SEMMODE 0660 #define SEMVALUE 1 diff --git a/src/lxc/lxclock.h b/src/lxc/lxclock.h index a02a0320c6..e00dd8ac36 100644 --- a/src/lxc/lxclock.h +++ b/src/lxc/lxclock.h @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __LXCLOCK_H -#define __LXCLOCK_H +#ifndef __LXC_LXCLOCK_H +#define __LXC_LXCLOCK_H #include /* For O_* constants */ #include /* For mode constants */ diff --git a/src/lxc/lxcseccomp.h b/src/lxc/lxcseccomp.h index 2f64c05dd2..bfafe3aec8 100644 --- a/src/lxc/lxcseccomp.h +++ b/src/lxc/lxcseccomp.h @@ -21,7 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _lxc_seccomp_h +#ifndef __LXC_LXCSECCOMP_H +#define __LXC_LXCSECCOMP_H #include "conf.h" diff --git a/src/lxc/lxcutmp.h b/src/lxc/lxcutmp.h index 81848d1288..062ecdf38e 100644 --- a/src/lxc/lxcutmp.h +++ b/src/lxc/lxcutmp.h @@ -21,6 +21,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef __LXC_LXCUTMP_H +#define __LXC_LXCUTMP_H + #include "config.h" struct lxc_handler; @@ -28,3 +31,4 @@ struct lxc_epoll_descr; int lxc_utmp_mainloop_add(struct lxc_epoll_descr *descr, struct lxc_handler *handler); +#endif diff --git a/src/lxc/mainloop.h b/src/lxc/mainloop.h index 21ef577440..46a820c669 100644 --- a/src/lxc/mainloop.h +++ b/src/lxc/mainloop.h @@ -21,8 +21,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _mainloop_h -#define _mainloop_h +#ifndef __LXC_MAINLOOP_H +#define __LXC_MAINLOOP_H #include #include "list.h" diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index 4ca4000cd5..f356adf217 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -106,8 +106,10 @@ static void lxc_monitor_fifo_send(struct lxc_msg *msg, const char *lxcpath) return; } - if (fcntl(fd, F_SETFL, O_WRONLY) < 0) + if (fcntl(fd, F_SETFL, O_WRONLY) < 0) { + close(fd); return; + } ret = write(fd, msg, sizeof(*msg)); if (ret != sizeof(*msg)) { diff --git a/src/lxc/monitor.h b/src/lxc/monitor.h index a7eb11052a..229696bd74 100644 --- a/src/lxc/monitor.h +++ b/src/lxc/monitor.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __monitor_h -#define __monitor_h +#ifndef __LXC_MONITOR_H +#define __LXC_MONITOR_H #include #include diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h index 64499cd3b8..28f17e6876 100644 --- a/src/lxc/namespace.h +++ b/src/lxc/namespace.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __namespace_h -#define __namespace_h +#ifndef __LXC_NAMESPACE_H +#define __LXC_NAMESPACE_H #include #include diff --git a/src/lxc/network.h b/src/lxc/network.h index 97f6b4d337..079d52a64a 100644 --- a/src/lxc/network.h +++ b/src/lxc/network.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _network_h -#define _network_h +#ifndef __LXC_NETWORK_H +#define __LXC_NETWORK_H /* * Convert a string mac address to a socket structure diff --git a/src/lxc/nl.h b/src/lxc/nl.h index 621cbc6c55..8e737fc8b3 100644 --- a/src/lxc/nl.h +++ b/src/lxc/nl.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __nl_h -#define __nl_h +#ifndef __LXC_NL_H +#define __LXC_NL_H /* * Use this as a good size to allocate generic netlink messages diff --git a/src/lxc/parse.h b/src/lxc/parse.h index ba7d639dff..8f753198b8 100644 --- a/src/lxc/parse.h +++ b/src/lxc/parse.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __parse_h -#define __parse_h +#ifndef __LXC_PARSE_H +#define __LXC_PARSE_H typedef int (*lxc_dir_cb)(const char *name, const char *directory, const char *file, void *data); diff --git a/src/lxc/rtnl.h b/src/lxc/rtnl.h index d13f2b3dd9..d9ad45d71b 100644 --- a/src/lxc/rtnl.h +++ b/src/lxc/rtnl.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __genl_h -#define __genl_h +#ifndef __LXC_RTNL_H +#define __LXC_RTNL_H /* * Use this as a good size to allocate route netlink messages diff --git a/src/lxc/start.c b/src/lxc/start.c index 21db8044fd..e6b4895cd9 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -69,6 +69,7 @@ #include "namespace.h" #include "lxcseccomp.h" #include "caps.h" +#include "bdev.h" #include "lsm/lsm.h" lxc_log_define(lxc_start, lxc); @@ -705,9 +706,6 @@ static int do_start(void *data) if (lxc_console_set_stdfds(handler) < 0) goto out_warn_father; - if (lxc_check_inherited(handler->conf, handler->sigfd)) - return -1; - /* If we mounted a temporary proc, then unmount it now */ tmp_proc_unmount(handler->conf); @@ -1057,6 +1055,21 @@ int __lxc_start(const char *name, struct lxc_conf *conf, handler->conf->need_utmp_watch = 0; } + if (geteuid() == 0 && !lxc_list_empty(&conf->id_map)) { + /* if the backing store is a device, mount it here and now */ + if (rootfs_is_blockdev(conf)) { + if (unshare(CLONE_NEWNS) < 0) { + ERROR("Error unsharing mounts"); + goto out_fini_nonet; + } + if (do_rootfs_setup(conf, name, lxcpath) < 0) { + ERROR("Error setting up rootfs mount as root before spawn"); + goto out_fini_nonet; + } + INFO("Set up container rootfs as host root"); + } + } + err = lxc_spawn(handler); if (err) { ERROR("failed to spawn '%s'", name); @@ -1157,6 +1170,9 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf, .argv = argv, }; + if (lxc_check_inherited(conf, -1)) + return -1; + conf->need_utmp_watch = 1; return __lxc_start(name, conf, &start_ops, &start_arg, lxcpath); } diff --git a/src/lxc/start.h b/src/lxc/start.h index e2d6bc8957..ca7891cdd9 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __lxc_state_h -#define __lxc_state_h +#ifndef __LXC_START_H +#define __LXC_START_H #include #include diff --git a/src/lxc/state.h b/src/lxc/state.h index bad29430d8..4d26ce6b58 100644 --- a/src/lxc/state.h +++ b/src/lxc/state.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _state_h -#define _state_h +#ifndef __LXC_STATE_H +#define __LXC_STATE_H typedef enum { STOPPED, STARTING, RUNNING, STOPPING, diff --git a/src/lxc/sync.h b/src/lxc/sync.h index fd129af948..930fcb3ea0 100644 --- a/src/lxc/sync.h +++ b/src/lxc/sync.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __lxc_sync_h -#define __lxc_sync_h +#ifndef __LXC_SYNC_H +#define __LXC_SYNC_H struct lxc_handler; diff --git a/src/lxc/utils.c b/src/lxc/utils.c index 2fb339600d..efec414905 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -44,8 +44,6 @@ #include "log.h" #include "lxclock.h" -#define MAX_STACKDEPTH 25 - lxc_log_define(lxc_utils, lxc); static int _recursive_rmdir_onedev(char *dirname, dev_t pdev) diff --git a/src/lxc/utils.h b/src/lxc/utils.h index b5e054cca3..f48f403308 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _utils_h -#define _utils_h +#ifndef __LXC_UTILS_H +#define __LXC_UTILS_H #include #include diff --git a/src/lxc/version.h b/src/lxc/version.h index 212bb0d494..e03158d8b2 100644 --- a/src/lxc/version.h +++ b/src/lxc/version.h @@ -20,12 +20,12 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _VERSION_H -#define _VERSION_H +#ifndef __LXC_VERSION_H +#define __LXC_VERSION_H #define LXC_VERSION_MAJOR 1 #define LXC_VERSION_MINOR 0 -#define LXC_VERSION_MICRO 3 -#define LXC_VERSION "1.0.3" +#define LXC_VERSION_MICRO 4 +#define LXC_VERSION "1.0.4" #endif diff --git a/src/lxc/version.h.in b/src/lxc/version.h.in index eb9f103536..803a46e46e 100644 --- a/src/lxc/version.h.in +++ b/src/lxc/version.h.in @@ -20,8 +20,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _VERSION_H -#define _VERSION_H +#ifndef __LXC_VERSION_H +#define __LXC_VERSION_H #define LXC_VERSION_MAJOR @LXC_VERSION_MAJOR@ #define LXC_VERSION_MINOR @LXC_VERSION_MINOR@ diff --git a/src/python-lxc/examples/api_test.py b/src/python-lxc/examples/api_test.py index 9f935d70c7..2abbb435fb 100755 --- a/src/python-lxc/examples/api_test.py +++ b/src/python-lxc/examples/api_test.py @@ -91,7 +91,6 @@ # A few basic checks of the current state assert("name" in container.get_keys("lxc.network.0")) assert(len(container.network) == 1) -assert(container.network[0].hwaddr.startswith("00:16:3e")) ## Starting the container print("Starting the container") @@ -181,6 +180,14 @@ assert(not container.running) assert(container.state == "STOPPED") +## Snapshotting the container +print("Snapshotting the container") +assert(not container.snapshot_list()) +assert(container.snapshot() == "snap0") +assert(len(container.snapshot_list()) == 1) +assert(container.snapshot_restore("snap0") is True) +assert(container.snapshot_destroy("snap0") is True) + ## Cloning the container print("Cloning the container as '%s'" % CLONE_NAME) clone = container.clone(CLONE_NAME) diff --git a/src/python-lxc/lxc.c b/src/python-lxc/lxc.c index f7ab09222b..1bc977a310 100644 --- a/src/python-lxc/lxc.c +++ b/src/python-lxc/lxc.c @@ -148,7 +148,7 @@ static lxc_attach_options_t *lxc_attach_parse_options(PyObject *kwds) PyObject *stdout_obj = NULL; PyObject *stderr_obj = NULL; PyObject *initial_cwd_obj = NULL; - PyObject *dummy; + PyObject *dummy = NULL; bool parse_result; lxc_attach_options_t default_options = LXC_ATTACH_OPTIONS_DEFAULT; @@ -257,7 +257,7 @@ static PyObject * LXC_arch_to_personality(PyObject *self, PyObject *arg) { long rv = -1; - PyObject *pystr; + PyObject *pystr = NULL; char *str; if (!PyUnicode_Check(arg)) { @@ -329,12 +329,20 @@ LXC_get_global_config_item(PyObject *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = {"key", NULL}; char* key = NULL; + const char* value = NULL; if (! PyArg_ParseTupleAndKeywords(args, kwds, "s|", kwlist, &key)) return NULL; - return PyUnicode_FromString(lxc_get_global_config_item(key)); + value = lxc_get_global_config_item(key); + + if (!value) { + PyErr_SetString(PyExc_KeyError, "Invalid configuration key"); + return NULL; + } + + return PyUnicode_FromString(value); } static PyObject * @@ -729,11 +737,12 @@ Container_create(Container *self, PyObject *args, PyObject *kwds) char* template_name = NULL; int flags = 0; char** create_args = {NULL}; - PyObject *retval = NULL, *vargs = NULL; + PyObject *retval = NULL; + PyObject *vargs = NULL; int i = 0; static char *kwlist[] = {"template", "flags", "args", NULL}; - if (! PyArg_ParseTupleAndKeywords(args, kwds, "s|iO", kwlist, + if (! PyArg_ParseTupleAndKeywords(args, kwds, "|siO", kwlist, &template_name, &flags, &vargs)) return NULL; @@ -1221,7 +1230,7 @@ Container_snapshot(Container *self, PyObject *args, PyObject *kwds) int retval = 0; int ret = 0; char newname[20]; - PyObject *py_comment_path; + PyObject *py_comment_path = NULL; if (! PyArg_ParseTupleAndKeywords(args, kwds, "|O&", kwlist, PyUnicode_FSConverter, &py_comment_path)) diff --git a/src/python-lxc/lxc/__init__.py b/src/python-lxc/lxc/__init__.py index d2330626af..47b25b8e4a 100644 --- a/src/python-lxc/lxc/__init__.py +++ b/src/python-lxc/lxc/__init__.py @@ -1,4 +1,5 @@ # +# -*- coding: utf-8 -*- # python-lxc: Python bindings for LXC # # (C) Copyright Canonical Ltd. 2012 @@ -32,7 +33,7 @@ version = _lxc.get_version() -class ContainerNetwork(): +class ContainerNetwork(object): props = {} def __init__(self, container, index): @@ -200,11 +201,11 @@ def append_config_item(self, key, value): return _lxc.Container.set_config_item(self, key, value) - def create(self, template, flags=0, args=()): + def create(self, template=None, flags=0, args=()): """ Create a new rootfs for the container. - "template" must be a valid template name. + "template" if passed must be a valid template name. "flags" (optional) is an integer representing the optional create flags to be passed. @@ -221,8 +222,13 @@ def create(self, template, flags=0, args=()): else: template_args = args - return _lxc.Container.create(self, template=template, - flags=flags, args=tuple(template_args)) + if template: + return _lxc.Container.create(self, template=template, + flags=flags, + args=tuple(template_args)) + else: + return _lxc.Container.create(self, flags=flags, + args=tuple(template_args)) def clone(self, newname, config_path=None, flags=0, bdevtype=None, bdevdata=None, newsize=0, hookargs=()): diff --git a/src/tests/lxc-test-autostart b/src/tests/lxc-test-autostart index 6c2f5aefb9..845a06a940 100755 --- a/src/tests/lxc-test-autostart +++ b/src/tests/lxc-test-autostart @@ -67,10 +67,12 @@ fi # Start it lxc-autostart -g lxc-auto-test lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't start" && exit 1) +sleep 5 # Restart it lxc-autostart -g lxc-auto-test -r lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't restart" && exit 1) +sleep 5 # Shut it down lxc-autostart -g lxc-auto-test -s -t 120 diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv index bbe1e08cf7..139b0807f5 100755 --- a/src/tests/lxc-test-unpriv +++ b/src/tests/lxc-test-unpriv @@ -92,7 +92,7 @@ chown -R $TUSER /run/user/$(id -u $TUSER) cd $HDIR if [ -e /sys/fs/cgroup/cgmanager/sock ]; then - for d in $(grep -v ^# /proc/cgroups | awk '{print $1}'); do + for d in $(cut -d : -f 2 /proc/self/cgroup); do dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \ string:$d string:$TUSER >/dev/null diff --git a/src/tests/lxc-test-usernic b/src/tests/lxc-test-usernic index 00f7c0cdc3..3265485f0b 100644 --- a/src/tests/lxc-test-usernic +++ b/src/tests/lxc-test-usernic @@ -85,7 +85,7 @@ lxc.id_map = g 0 910000 10000 EOF if [ -e /sys/fs/cgroup/cgmanager/sock ]; then - for d in $(grep -v ^# /proc/cgroups | awk '{print $1}'); do + for d in $(cut -d : -f 2 /proc/self/cgroup); do dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \ string:$d string:usernic-user >/dev/null diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in index 93af623037..ad11f0aa72 100755 --- a/src/tests/lxc-test-usernic.in +++ b/src/tests/lxc-test-usernic.in @@ -85,7 +85,7 @@ lxc.id_map = g 0 910000 10000 EOF if [ -e /sys/fs/cgroup/cgmanager/sock ]; then - for d in $(grep -v ^# /proc/cgroups | awk '{print $1}'); do + for d in $(cut -d : -f 2 /proc/self/cgroup); do dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \ string:$d string:usernic-user >/dev/null diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index d8c6674322..7a22d5ead4 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc-alpine.in @@ -362,6 +362,7 @@ apk_arch=$arch case "$arch" in i[3-6]86) apk_arch=x86 + lxc_arch=x86 ;; x86) lxc_arch=i686 diff --git a/templates/lxc-archlinux.in b/templates/lxc-archlinux.in old mode 100644 new mode 100755 index 45243cf2d7..ec14a9a7bf --- a/templates/lxc-archlinux.in +++ b/templates/lxc-archlinux.in @@ -111,6 +111,8 @@ for i in systemd-udevd.service \ done # set default systemd target ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target +# enable sigpwr signal handling in systemd as otherwise lxc-stop won't work +ln -s /usr/lib/systemd/system/poweroff.target /etc/systemd/system/sigpwr.target # initialize pacman keyring pacman-key --init pacman-key --populate archlinux @@ -152,7 +154,7 @@ lxc.cgroup.devices.allow = c 5:2 rwm lxc.cgroup.devices.allow = c 136:* rwm EOF - grep -q "^lxc.rootfs" ${config_path}/config 2>/dev/null || echo "lxc.rootfs = ${rootfs_path}" >> ${config_path}/config + grep -q "^lxc.rootfs" ${config_path}/config 2>/dev/null || echo "lxc.rootfs = ${path}/rootfs" >> ${config_path}/config cat > "${config_path}/fstab" << EOF sysfs sys sysfs defaults 0 0 diff --git a/templates/lxc-download.in b/templates/lxc-download.in index a06c0a401e..31e0d279f4 100644 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -116,8 +116,17 @@ gpg_setup() { mkdir -p "$DOWNLOAD_TEMP/gpg" chmod 700 "$DOWNLOAD_TEMP/gpg" export GNUPGHOME="$DOWNLOAD_TEMP/gpg" - if ! gpg --keyserver $DOWNLOAD_KEYSERVER \ + + success= + for i in $(seq 3); do + if gpg --keyserver $DOWNLOAD_KEYSERVER \ --recv-keys ${DOWNLOAD_KEYID} >/dev/null 2>&1; then + success=1 + break + fi + done + + if [ -z "$success" ]; then echo "ERROR: Unable to fetch GPG key from keyserver." exit 1 fi diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in index 27aeeb0ec1..a1393c2984 100644 --- a/templates/lxc-fedora.in +++ b/templates/lxc-fedora.in @@ -359,10 +359,9 @@ configure_fedora_systemd() rm -f ${rootfs_path}/etc/systemd/system/default.target touch ${rootfs_path}/etc/fstab chroot ${rootfs_path} ln -s /dev/null /etc/systemd/system/udev.service - chroot ${rootfs_path} ln -s /dev/null /etc/systemd/system/systemd-journald.service chroot ${rootfs_path} ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target # Make systemd honor SIGPWR - chroot ${rootfs_path} ln -s /usr/lib/systemd/system/halt.target /etc/systemd/system/ + chroot ${rootfs_path} ln -s /usr/lib/systemd/system/halt.target /etc/systemd/system/sigpwr.target #dependency on a device unit fails it specially that we disabled udev # sed -i 's/After=dev-%i.device/After=/' ${rootfs_path}/lib/systemd/system/getty\@.service # diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in index 92361f8328..2a963234f7 100644 --- a/templates/lxc-oracle.in +++ b/templates/lxc-oracle.in @@ -129,6 +129,8 @@ EOF fi sed -i 's|session[ \t]*required[ \t]*pam_selinux.so[ \t]*close|#session required pam_selinux.so close|' $container_rootfs/etc/pam.d/login sed -i 's|session[ \t]*required[ \t]*pam_selinux.so[ \t]*open|#session required pam_selinux.so open|' $container_rootfs/etc/pam.d/login + sed -i 's|session[ \t]*required[ \t]*pam_selinux.so[ \t]*close|#session required pam_selinux.so close|' $container_rootfs/etc/pam.d/sshd + sed -i 's|session[ \t]*required[ \t]*pam_selinux.so[ \t]*open|#session required pam_selinux.so open|' $container_rootfs/etc/pam.d/sshd # setting /proc/$$/loginuid doesn't work under user namespace, which # prevents logins from working @@ -294,6 +296,10 @@ TYPE=Ethernet EOF # set the hostname + if [ $container_release_major -ge "7" ]; then + # systemd honors /etc/hostname + echo "$name" >$container_rootfs/etc/hostname + fi cat < $container_rootfs/etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no @@ -306,10 +312,6 @@ EOF # this file has to exist for libvirt/Virtual machine monitor to boot the container touch $container_rootfs/etc/mtab - # don't put devpts,proc, nor sysfs in here, it will already be mounted for us by lxc/libvirt - cat < $container_rootfs/etc/fstab -EOF - # sem_open(3) checks that /dev/shm is SHMFS_SUPER_MAGIC, so make sure to mount /dev/shm (normally done by dracut initrd) as tmpfs if [ $container_release_major = "4" -o $container_release_major = "5" ]; then echo "mount -t tmpfs tmpfs /dev/shm" >>$container_rootfs/etc/rc.sysinit @@ -330,22 +332,35 @@ EOF # allow root login on console, tty[1-4], and pts/0 for libvirt echo "# LXC (Linux Containers)" >>$container_rootfs/etc/securetty echo "lxc/console" >>$container_rootfs/etc/securetty - echo "lxc/tty1" >>$container_rootfs/etc/securetty - echo "lxc/tty2" >>$container_rootfs/etc/securetty - echo "lxc/tty3" >>$container_rootfs/etc/securetty - echo "lxc/tty4" >>$container_rootfs/etc/securetty + for i in 1 2 3 4; do + echo "lxc/tty$i" >>$container_rootfs/etc/securetty + done echo "# For libvirt/Virtual Machine Monitor" >>$container_rootfs/etc/securetty - echo "pts/0" >>$container_rootfs/etc/securetty + for i in 0 1 2 3 4; do + echo "pts/$i" >>$container_rootfs/etc/securetty + done # prevent mingetty from calling vhangup(2) since it fails with userns if [ -f $container_rootfs/etc/init/tty.conf ]; then sed -i 's|mingetty|mingetty --nohangup|' $container_rootfs/etc/init/tty.conf fi + # create maygetty which only spawns a getty on the console when running + # under lxc, not libvirt-lxc which symlinks /dev/console to the same pty + # as /dev/tty1 + cat <$container_rootfs/sbin/maygetty +#!/bin/sh +if [ "\$container" = "lxc" ]; then + exec /sbin/mingetty \$@ +fi +exec sleep infinity +EOF + chmod 755 $container_rootfs/sbin/maygetty + # start a getty on /dev/console, /dev/tty[1-4] if [ $container_release_major = "4" -o $container_release_major = "5" ]; then sed -i 's|mingetty|mingetty --nohangup|' $container_rootfs/etc/inittab - sed -i '/1:2345:respawn/i cns:2345:respawn:/sbin/mingetty --nohangup --noclear console' $container_rootfs/etc/inittab + sed -i '/1:2345:respawn/i cns:2345:respawn:/sbin/maygetty --nohangup --noclear console' $container_rootfs/etc/inittab sed -i '/5:2345:respawn/d' $container_rootfs/etc/inittab sed -i '/6:2345:respawn/d' $container_rootfs/etc/inittab fi @@ -359,9 +374,10 @@ EOF start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] +env container respawn -exec /sbin/mingetty --nohangup --noclear /dev/console +exec /sbin/maygetty --nohangup --noclear /dev/console EOF fi @@ -386,42 +402,6 @@ exec init 0 EOF fi - # create required devices. note that /dev/console will be created by lxc - # or libvirt itself to be a symlink to the right pty. - # take care to not nuke /dev in case $container_rootfs isn't set - dev_path="$container_rootfs/dev" - if [ $container_rootfs != "/" -a -d $dev_path ]; then - rm -rf $dev_path - mkdir -p $dev_path - if can_chcon; then - # ensure symlinks created in /dev have the right context - chcon -t device_t $dev_path - fi - fi - mknod -m 666 $dev_path/null c 1 3 - mknod -m 666 $dev_path/zero c 1 5 - mknod -m 666 $dev_path/random c 1 8 - mknod -m 666 $dev_path/urandom c 1 9 - mkdir -m 755 $dev_path/pts - mkdir -m 1777 $dev_path/shm - mknod -m 666 $dev_path/tty c 5 0 - mknod -m 666 $dev_path/tty0 c 4 0 - mknod -m 666 $dev_path/tty1 c 4 1 - mknod -m 666 $dev_path/tty2 c 4 2 - mknod -m 666 $dev_path/tty3 c 4 3 - mknod -m 666 $dev_path/tty4 c 4 4 - mknod -m 666 $dev_path/full c 1 7 - mknod -m 600 $dev_path/initctl p - - # set selinux labels same as host - if can_chcon; then - for node in null zero random urandom pts shm \ - tty tty0 tty1 tty2 tty3 tty4 full ; - do - chcon --reference /dev/$node $dev_path/$node 2>/dev/null - done - fi - # start with a clean /var/log/messages rm -f $container_rootfs/var/log/messages @@ -492,21 +472,61 @@ container_rootfs_clone() fi } +container_rootfs_dev_create() +{ + # create required devices. note that /dev/console will be created by lxc + # or libvirt itself to be a symlink to the right pty. + # take care to not nuke /dev in case $container_rootfs isn't set + dev_path="$container_rootfs/dev" + if [ $container_rootfs != "/" -a -d $dev_path ]; then + rm -rf $dev_path + fi + mkdir -p $dev_path + if can_chcon; then + # ensure symlinks created in /dev have the right context + chcon -t device_t $dev_path + fi + mknod -m 666 $dev_path/null c 1 3 + mknod -m 666 $dev_path/zero c 1 5 + mknod -m 666 $dev_path/random c 1 8 + mknod -m 666 $dev_path/urandom c 1 9 + mkdir -m 755 $dev_path/pts + mkdir -m 1777 $dev_path/shm + mknod -m 666 $dev_path/tty c 5 0 + mknod -m 666 $dev_path/tty1 c 4 1 + mknod -m 666 $dev_path/tty2 c 4 2 + mknod -m 666 $dev_path/tty3 c 4 3 + mknod -m 666 $dev_path/tty4 c 4 4 + mknod -m 666 $dev_path/full c 1 7 + mknod -m 600 $dev_path/initctl p + + # set selinux labels same as host + if can_chcon; then + for node in null zero random urandom pts shm \ + tty tty0 tty1 tty2 tty3 tty4 full ; + do + chcon --reference /dev/$node $dev_path/$node 2>/dev/null + done + fi +} + container_rootfs_create() { + if can_chcon; then + chcon --reference / $container_rootfs 2>/dev/null + fi + cmds="rpm wget yum" if [ $container_release_major -lt "6" ]; then if [ $host_distribution = "Ubuntu" -o $host_distribution = "Debian" ]; then db_dump_cmd="db5.1_dump" - db_load_cmd="db4.3_load" fi if [ $host_distribution = "OracleServer" -o \ $host_distribution = "Fedora" ]; then db_dump_cmd="db_dump" - db_load_cmd="db43_load" fi - cmds="$cmds $db_dump_cmd $db_load_cmd file" + cmds="$cmds $db_dump_cmd file" fi for cmd in $cmds; do which $cmd >/dev/null 2>&1 @@ -583,11 +603,19 @@ container_rootfs_create() sed -i "s|enabled=1|enabled=0|" $container_rootfs/etc/yum.repos.d/$repofile sed -i "/\[$repo\]/,/\[/ s/enabled=0/enabled=1/" $container_rootfs/etc/yum.repos.d/$repofile + container_rootfs_dev_create + + # don't put devpts,proc, nor sysfs in here, it will already be mounted for us by lxc/libvirt + echo "" >$container_rootfs/etc/fstab + # create rpm db, download and yum install minimal packages mkdir -p $container_rootfs/var/lib/rpm rpm --root $container_rootfs --initdb yum_args="--installroot $container_rootfs --disablerepo=* --enablerepo=$repo -y --nogpgcheck" min_pkgs="yum initscripts passwd rsyslog vim-minimal openssh-server openssh-clients dhclient chkconfig rootfiles policycoreutils oraclelinux-release" + if [ $container_release_major -lt "6" ]; then + min_pkgs="$min_pkgs db4-utils" + fi # we unshare the mount namespace because yum installing the ol4 # packages causes $rootfs/proc to be mounted on @@ -640,7 +668,7 @@ container_rootfs_create() echo "Fixing (downgrading) rpm database from version $db_version" rm -f $container_rootfs/var/lib/rpm/__db* for db in $container_rootfs/var/lib/rpm/* ; do - $db_dump_cmd $db |$db_load_cmd $db.new + $db_dump_cmd $db |chroot $container_rootfs db_load /var/lib/rpm/`basename $db`.new mv $db.new $db done fi diff --git a/templates/lxc-plamo.in b/templates/lxc-plamo.in index 644b8d03a0..24ecb7e6fd 100644 --- a/templates/lxc-plamo.in +++ b/templates/lxc-plamo.in @@ -237,6 +237,10 @@ configure_plamo() { rm -f $rootfs/etc/rc.d/rc.inet1.tradnet sh /tmp/netconfig.rconly rm -f /tmp/netconfig.rconly + ed - $rootfs/etc/rc.d/rc.inet1.tradnet <<- "EOF" + g/cmdline/s/if/& false \&\&/ + w + EOF return 0 } diff --git a/templates/lxc-sshd.in b/templates/lxc-sshd.in index 7e3d3d8b70..569f12efb8 100644 --- a/templates/lxc-sshd.in +++ b/templates/lxc-sshd.in @@ -218,7 +218,7 @@ fi if [ $0 = "/sbin/init" ]; then PATH="$PATH:/bin:/sbin:/usr/sbin" - check_for_cmd @LXCINITDIR@/lxc/lxc-init + check_for_cmd @SBINDIR@/init.lxc check_for_cmd sshd sshd_path=$cmd_path @@ -237,7 +237,7 @@ EOF ifconfig eth0 |grep inet fi - exec @LXCINITDIR@/lxc/lxc-init -- $sshd_path + exec @SBINDIR@/init.lxc -- $sshd_path exit 1 fi