Commit Graph

1923 Commits

Author SHA1 Message Date
Alexander Khryukin
f1d8e7ed86 fix .gitignore file and add a little improvements to openmandriva template
Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:32:31 -04:00
Alexander Khryukin
9aad9d12c9 Add an OpenMandriva distro lxc-openmandriva template
Signed-off-by: Alexander Khryukin <alexander@mezon.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:32:02 -04:00
KATOH Yasufumi
92cbfdaf68 template: Improved lxc-plamo template
lxc-plamo now work with any distribution other than Plamo Linux.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-10 13:30:44 -04:00
KATOH Yasufumi
cab7912308 template: Add Plamo Linux template
This template allows to create Plamo Linux container on Plamo
Linux. Plamo Linux is Japanese distribution, which is originally based
on Slackware Linux.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-09 22:51:49 -04:00
Stéphane Graber
e63b2dbc34
Add lxc-test-ubuntu to the dist tarball
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-09 18:09:56 -04:00
Serge Hallyn
1e0f62acaa ubuntu-cloud-prep hook: fix debug helper to not inappropriately fail
Bug found by Vincent Ladeuil <vila+ci@canonical.com>
Fix suggested by Scott Moser <smoser@ubuntu.com>

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-09 13:03:56 -05:00
Dwight Engen
41246cee3b ensure gnutls is initialized before use
Section 7.1.2 of the gnutls info manual states that it must be
initialized with a call to gnutls_global_init before use. This
fixes the syslog warning I was seeing:

  lxc-create: Libgcrypt warning: missing initialization -
              please fix the application

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 12:47:58 -04:00
KATOH Yasufumi
f220889fd2 doc: Fix Japanese lxc.conf(5) man page
Same as the commit 3157e67395

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 12:08:45 -04:00
KATOH Yasufumi
ebe0aeb19c doc: Generate Japanese lxc-snapshot(1) man page
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 12:08:43 -04:00
Stéphane Graber
9c3bc32c57
lxc-ubuntu-cloud: Cope with spaces in paths
Reported-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 10:51:53 -04:00
Scott Moser
494fd6b390
lxc-ubuntu-cloud: pass --numeric-owner and -p to untar
Just following up here, Serge raised the question of whether or not the
other two invocations of 'tar' in this script need '--numeric-owner'.
They probably should have it, although its of little concern because the
'build_root_tgz' path is only taken if there is no '-root.tar.gz' file for
download, and the only supported ubuntu release without the -root.tar.gz
download is 10.04 at this point.

Anyway, below is a more complete diff, also including a fix as
'--numeric-uid' is not a valid option to tar.  The name is
'--numeric-owner'.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-08 10:25:30 -04:00
Serge Hallyn
034ef75d49 coverity: free dent_buf on error path (cgroup.c)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-07 14:10:29 -05:00
Serge Hallyn
5903da8289 free cgroup_tasks_fn after use
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-07 14:07:43 -05:00
Serge Hallyn
9baa57bdd4 coverity: closedir on error path
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-07 14:03:20 -05:00
Dwight Engen
dab75acca0 always include the ja manpage sources in make dist
These need to be in the dist tarball even if the host packaging system
doesn't have docbook2x, otherwise configure will fail to find them. Also,
the build system may have docbook2x, even if the packaging system does not.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 15:04:50 -05:00
Dwight Engen
3157e67395 fix errors when using docbook2man
docbook2man picks up some errors that docbook2x does not, fixing them
isn't harmful to docbook2x. The only real change is adding <para> and
<citerefentry> tags.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 15:04:48 -05:00
Dwight Engen
5e00ff016a oracle template: add openssh-clients to enable scp in/out of container
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 14:54:58 -05:00
Michael H. Warfield
6766033125 templates/lxc-fedora Network startup w/o Network Manager
This patches the Fedora template to insure that the legacy network
startup scripts are enabled when NetworkManager has not been installed
in the container (default).

It also fixes a login problem with pam_loginuid.so in a container.
https://bugzilla.redhat.com/show_bug.cgi?id=966807

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>

--
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 14:54:56 -05:00
Serge Hallyn
0655a606da trivial: remove trailing whitespce from lxc-fedora
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 14:54:54 -05:00
Serge Hallyn
fe5c5ea693 lxc-fedora: remove 4:0 and 4:1 from devices whitelist
They are the real /dev/tty{0,1}, which are physical consoles.  Lxc
bind-mounts over them.  Don't let the container use these!

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 10:53:21 -05:00
S.Çağlar Onur
f3e52710c2 call lxc_container_put when appropriate
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 08:45:26 -05:00
Stéphane Graber
2ef89d565c lxc-ubuntu: Remove trim option
Container trimming is a bad idea in general, Ubuntu since 12.04 allows
standard systems to run in containers and we've got separate code to
deal with 10.04, so let's just drop trim.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-04 08:45:25 -05:00
Michael H. Warfield
449989ac38 templates/lxc-fedora Rework for distro independence.
This patch reworks the Fedora template to operate in the most "distro
agnostic" manner possible.  It should even run on distros where rpm and
yum are not present and not available or may be incompatible.  It
depends on the most basic set of system facilities like rsync but does
require squashfs support also be available to mount a LiveOS runtime.

Based on comments at Linux Plumbers, what I had been referring to as a
"run time environment" or RTE has been renamed in the code to refer to
it as a "bootstrap".  It has been tested on Fedora (of course),
OpenSuse, Ubuntu, and Oracle (latest host versions of each) building
Fedora containers of F19 back through F9.  Varying levels of database
problems were encountered from F11 and back and are "will not fix" due
to versions being long EOL.  F15 and F16 build but do not run "out of
the box" due to systemd version issues and those are also "will not fix"
for the same reasons.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-03 21:03:20 -05:00
Serge Hallyn
025f59ab98 add basic lxc-test-ubuntu (v3)
Some features of lxc - networking and LSM configuration for instance -
are generally configured by the distro packages.  This program
tests the Ubuntu configuration.

changelog v2:
  Switch to lxc-info -i to detect ip address as stgraber suggested
  Don't look for 'expect' as I'm not using it yet.
changelog v3:
  Make sure to only read one ip address from container.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-03 12:23:07 -05:00
Serge Hallyn
a5a8250854 confile.c: cast size_t to prevent compile failure on 386
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-03 12:10:07 -05:00
Stéphane Graber
f5abd74d1a Improve behaviour for unprivileged users
This mostly changes two things:
 - Only log to the container's logfile on start/stop/restart/execute
 - Call may_control() every time we use the API and return
   "Insufficient privileges" on failure.

NOTE: I didn't test every single one of those but I'm fairly confident
      in my copy/paste abilities and I confirmed they all build fine at least.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-03 09:34:55 -05:00
Serge Hallyn
17232fefae add new tests to .gitignore
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-03 09:34:54 -05:00
Serge Hallyn
2aa123185e add reboot test
It's really more of a kernel check, but worth having.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-03 09:34:52 -05:00
Stéphane Graber
8111adfde0
lxc-checkconfig: suggest modprobe configs
give hint to user to modprobe configs (altho could just modprobe it?)

Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 17:22:52 -04:00
Stéphane Graber
51e7a87468
Check return value of ifa_get_local_ip
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-02 17:18:48 -04:00
Stéphane Graber
c61eaadcf8
lxc-fedora: Show usage when no name is passed
Reported-by: Anatoly Techtonik
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 13:11:24 -04:00
Stéphane Graber
a8aa709c9d
lxc_init: Use sig_atomic_t for was_interrupted
Suggested-by: Markus Elfring
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 12:32:52 -04:00
Andrey Mazo
01660cccb9 Avoid ldconfig due to cross-compilation problems.
Otherwise, it cases problems on cbuild endianness != ctarget endianness
setups because /sbin/ldconfig expects elf header in the wrong endianness.

Signed-off-by: Andrey Mazo <ahippo@yandex.ru>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 12:28:33 -04:00
Dwight Engen
bd79cb223d fix lxc-info segv on stopped container
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 12:21:31 -04:00
Stéphane Graber
8983aa6e1e
fedora: Use consistent tab/space indent
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 11:47:33 -04:00
Renich Bon Ciric
431fdc4272 Update lxc-fedora.in
Fedora 19's release has no -1 revision; it's a -2 revision actually:
ftp://mirrors.kernel.org/fedora/releases/19/Fedora/x86_64/os/Packages/f/

Signed-off-by: Renich Bon Ciric <renich@woralelandia.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 11:45:52 -04:00
KATOH Yasufumi
99282c429a doc: Fix some typos
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 11:43:55 -04:00
KATOH Yasufumi
cab158ed3c doc: Remove unnecessary Diagnostic entry in lxc-stop(1)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-02 11:43:43 -04:00
KATOH Yasufumi
996c63c73e doc: Update lxc-monitor(1) man page
- Update to commit 'fbf050e4c211030eb343008583f76605dfaaef38'
- Improve translation

Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-10-02 09:09:45 -05:00
Dwight Engen
fbf050e4c2 lxc-monitor default name to .* to monitor all containers
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-01 10:31:41 -05:00
Dwight Engen
291c42dac0 gitignore doc/ja/legacy/*.1
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-01 09:21:31 -05:00
KATOH Yasufumi
492d0d55c3 doc: Update Japanese lxc.conf(5) man page
Add description of automatic mounting options
2013-09-30 19:22:07 -05:00
KATOH Yasufumi
3fd391243e doc: Update Japanese lxc-info(1) man page
Add description of '-i' option
2013-09-30 19:22:07 -05:00
KATOH Yasufumi
a5ba96715d doc: Update Japanese man pages translation
* sync current English man pages on master branch
* delete lxc-shutdown.sgml.in
* add lxc-snapshot.sgml.in
* update FSF address (same as 250b1eec71)
* remove trailing whitespaces in legacy/lxc-ls.sgml.in (same as 8900b9eb25)
2013-09-30 19:22:07 -05:00
Dwight Engen
6d03d92ab7 refactor string conf items into common function
- When doing the selinux change, I noticed that there was a lot of
  duplication of code in handing string configuration items, so I
  refactored this into a common function.

- Added a config_string_max that can be passed a maximum acceptable
  length, used to limit ttydir to NAME_MAX.

- The behavior of config_seccomp was different than other strings: if the
  item was already defined, then the second attempt to set it would fail
  instead of just replacing the value. Changed to just replace the value.

- Remove unused key and lxc_conf arguments to config_path_item().

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-09-30 17:21:11 -05:00
Serge Hallyn
e59536145c RFC: lxclock: drop the chown+chmod of lockdir
The original rationale for this was to make sure that if
lxcpath was /home/serge/lxcbase, then then lockdir
(/run/user/serge/lock/lxc/home/serge/lxcbase) would be
owned by the same user as /home/serge/lxcbase.

The only user who can chown to other uids (without CAP_CHOWN
added to fP) is root, who shouldn't be mucking with non-root
owned containers anyway.  In the meantime this causes a bunch
of noise for arguably no benefit.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-09-30 16:23:34 -05:00
Serge Hallyn
243cae25b5 tests/getkeys: return 0 on success
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-09-30 15:53:11 -05:00
Serge Hallyn
b494d2ddf7 add c->may_control
This is an api function which will return false if the container
is running, and the caller may not talk to its monitor over its
command socket.  Otherwise - if the container is not running, or
the caller may access it - it returns true.

We can use this in several tools early on to prevent the segvs
etc which we currently get.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-30 13:21:52 -05:00
Stéphane Graber
fe218ca383
Fix crasher in get_ips
Check that the interface structure is not NULL before trying to access
its members.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-29 19:41:52 -04:00
Stéphane Graber
a24b871206
Fix typo
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-27 16:00:40 -04:00