Commit Graph

3903 Commits

Author SHA1 Message Date
Christian Brauner
2fa8e2cd0a Merge pull request #811 from hallyn/2016-02-09/destroyquiet
lxc_destroy: be quiet if asked
2016-02-10 01:25:04 +01:00
Serge Hallyn
2f0e6b7945 lxc_destroy: be quiet if asked
As per https://bugs.launchpad.net/bugs/1543016.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-02-09 16:07:32 -08:00
Christian Brauner
f97ab3a639 Merge pull request #808 from hallyn/2016-02-07/aa.2
apparmor: don't fail if current aa label is given
2016-02-08 22:27:05 +01:00
Serge Hallyn
374625aa3f apparmor: don't fail if current aa label is given
Ideally a container configuration will specify 'unchanged' if
it wants the container to use the current (parent) profile.  But
lxd passes its current label.  Support that too.

Note that if/when stackable profiles exist, this behavior may
or may not be what we want.  But the code to deal with aa
stacking will need some changes anyway so this is ok.

With this patch, I can create nested containers inside a
lxd xenial container both using

lxc launch x2

and unprivileged

lxc-start -n x2

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-02-08 12:44:11 -08:00
Stéphane Graber
e8f8436cc1 Merge pull request #805 from benaryorg/patch-1
fix typo
2016-02-05 21:49:13 +01:00
Katze
740fe426b7 fix typo
Signed-off-by: benaryorg <binary@benary.org>
2016-02-05 18:54:45 +01:00
Serge Hallyn
c3d25c16ef Merge pull request #801 from brauner/2016-02-03/automatic_overlay_for_containers_without_rootfs
allow overlay lxc.mount.entry with no rootfs
2016-02-04 09:41:31 -08:00
Christian Brauner
9769034f65 allow overlay lxc.mount.entry with no rootfs
Allow lxc.mount.entry entries for containers without a rootfs.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-02-04 10:05:27 +01:00
Christian Brauner
8d1b71bb81 Merge pull request #798 from hallyn/2016-02-02/commentrootfs
Comment the lxc_rootfs structure
2016-02-04 08:20:53 +00:00
Serge Hallyn
59bb869809 Comment the lxc_rootfs structure
Comment rootfs.path and rootfs.mount so people can better figure
out which to use.

Remove the unused pivotdir argument from setup_rootfs_pivot_root().
Remove the unused pivot member of the lxc_rootfs struct.  And just
return 0 (success) when someone passes a lxc.pivotdir entry.  One
day we'll turn that into an error, but not yet...

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-02-03 16:13:57 -08:00
Stéphane Graber
2a2d3caf57 Merge pull request #803 from tych0/add-fuse-kernel-config-check
lxc-checkconfig: warn about fuse as well
2016-02-04 01:10:44 +01:00
Tycho Andersen
8283fda23b lxc-checkconfig: warn about fuse as well
Since we need fuse to run lxcfs, which is required by systemd, let's warn
about that as well.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
2016-02-03 16:54:50 -07:00
Serge Hallyn
6b7c60e15f Merge pull request #800 from brauner/2016-02-03/no_rootfs_implies_abspath
no rootfs => mounts always relative to host's /
2016-02-03 09:49:19 -08:00
Christian Brauner
1433c9f9b6 no rootfs => mounts are always relative to hosts /
All lxc.mount.entry entries will be relative to the hosts / when a container
does not specify a lxc.rootfs.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-02-03 18:45:07 +01:00
Serge Hallyn
e855f21476 Merge pull request #799 from brauner/2016-02-03/aufs_mkdir_to_lxcaufs
move and rename mount_entry_create_aufs_dirs()
2016-02-03 09:42:36 -08:00
Christian Brauner
1d52bdf7b6 move and rename mount_entry_create_aufs_dirs()
- The function mount_entry_create_aufs_dirs() moves from conf.c to
  lxcaufs.{c,h} where it belongs.
- In accordance with the "aufs_" prefix naming scheme for functions associated
  with lxcaufs.{c,h} mount_entry_create_aufs_dirs() becomes aufs_mkdir().
- Add aufs_get_rootfs() which returns the rootfs for an aufs lxc.rootfs.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-02-03 10:39:48 +01:00
Serge Hallyn
cefbc615ac Merge pull request #797 from brauner/2016-02-02/fix_execute_null_ptr_deref
Fix mount_entry_on_generic()
2016-02-02 20:32:26 -08:00
Christian Brauner
ec50007fc2 Fix mount_entry_on_generic()
In mount_entry_on_generic() we dereferenced a NULL pointer whenever a container
without a rootfs was created. (Since mount_entry_on_systemfs() passes them with
NULL.) We have mount_entry_on_generic() check whether rootfs != NULL.

We also check whether rootfs != NULL in the functions ovl_mkdir() and
mount_entry_create_aufs_dirs() and bail immediately. Rationale: For overlay and
aufs lxc.mount.entry entries users give us absolute paths to e.g. workdir and
upperdir which we create for them. We currently use rootfs->path and the
lxcpath for the container to check that users give us a sane path to create
those directories under and refuse if they do not. If we want to allow overlay
mounts for containers without a rootfs they can easily be reworked.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-02-03 00:29:58 +01:00
Stéphane Graber
5e75dea27b Merge pull request #796 from brauner/2016-02-02/fix_execute_null_ptr_deref
Fix NULL-ptr derefs for container without rootfs
2016-02-02 15:20:27 +01:00
Christian Brauner
1ec0e8e3fd Fix NULL-ptr derefs for container without rootfs
Since we allow containers to be created without a rootfs most checks in conf.c
are not sane anymore. Instead of just checking if rootfs->path != NULL we need
to check whether rootfs != NULL.

Minor fixes:
- Have mount_autodev() always return -1 on failure: mount_autodev() returns 0
  on success and -1 on failure. But when the return value of safe_mount() was
  checked in mount_autodev() we returned false (instead of -1) which caused
  mount_autodev() to return 0 (success) instead of the correct -1 (failure).

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-02-02 14:43:33 +01:00
Stéphane Graber
06b5b4d96a Merge pull request #795 from brauner/2016-02-02/lxc_ls_exit_zero
lxc-ls: exit 0 when path is not found
2016-02-02 13:21:11 +01:00
Christian Brauner
607d784d34 lxc-ls: exit 0 when path is not found
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-02-02 12:46:15 +01:00
Christian Brauner
57e40de3bd Merge pull request #793 from stgraber/master
Remove legacy versions of lxc-ls
2016-02-02 11:45:30 +00:00
Stéphane Graber
5de4efe3b3 Fix typo
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-02 12:16:52 +01:00
Stéphane Graber
94891ea3e4 Remove legacy versions of lxc-ls
lxc-ls nowadays is a C binary so there's no need to keep the python and
shell versions around anymore, remove them from the branch and cleanup
documentation and Makefiles.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-02 12:16:52 +01:00
Christian Brauner
81db418925 Merge pull request #794 from Blub/next
apparmor: allow binding /run/{,lock/} -> /var/run/{,lock/}
2016-02-02 11:06:03 +00:00
Wolfgang Bumiller
4a491a31c2 apparmor: allow binding /run/{,lock/} -> /var/run/{,lock/}
Some systems need to be able to bind-mount /run to /var/run
and /run/lock to /var/run/lock. (Tested with opensuse 13.1
containers migrated from openvz.)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-02-02 09:18:11 +01:00
Stéphane Graber
f1ed87e16c Merge pull request #787 from ysbnim/master
Update Korean manpages
2016-02-01 14:04:39 +01:00
Sungbae Yoo
275435b402 gitignore doc/ko/legacy/*.1
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-02-01 20:55:30 +09:00
Sungbae Yoo
83a6b14280 doc: update overlayfs and aufs in Japanese lxc.container.conf(5)
add the description of multiple lower layer.
Update for commit 280d237

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-02-01 20:52:41 +09:00
Sungbae Yoo
c988c6f689 doc: Add network clear option to Korean lxc.container.conf(5)
Update for commit 020104c

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-02-01 20:52:31 +09:00
Sungbae Yoo
8dd2c382e1 doc: add clear behaviour of list options to Korean lxc.container.conf(5)
Update for commit ff68914

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-02-01 20:52:22 +09:00
Stéphane Graber
8048df317d
change version to 2.0.0.beta2 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-01 12:09:20 +01:00
Stéphane Graber
d741ddc880 Merge pull request #786 from brauner/2016-01-31/lxc_copy_fix
lxc-copy: cleanup
2016-02-01 11:40:04 +01:00
Stéphane Graber
da1f8f26b5
Also move lxc-device in translated docs
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-01 11:28:28 +01:00
Wolfgang Bumiller
03f09a8ada doc: always enable lxc-device.1
Commit ea4679694 replaced the python implementation with a
C one.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-01 11:27:01 +01:00
Christian Brauner
534dfdeb6b lxc-copy: cleanup
- make free_mnts() work directly on the globals mnt_table and mnt_table_size
- have free_mnts() set mnt_table = NULL and mnt_table_size = 0 when its done to
  avoid double frees
- simplify error-handling in do_clone_ephemeral()
- do_clone_ephemeral(): when chmod() falls to set permissions on the temporary
  folder we created for mkdtemp() remove the folder
- simplify error handling in main()

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
2016-02-01 10:28:43 +01:00
KATOH Yasufumi
ddf81220fa doc: update overlayfs and aufs in Japanese lxc.container.conf(5)
add the description of multiple lower layer.
Update for commit 280d237

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-01 09:44:17 +01:00
KATOH Yasufumi
2a839fde90 doc: Adapt manpage for Japanese lxc-ls to new C implementation
Update for commit 37cf83e

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-01 09:44:17 +01:00
KATOH Yasufumi
3f45936bd3 doc: Add network clear option to Japanese lxc.container.conf(5)
Update for commit 020104c

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-01 09:44:17 +01:00
KATOH Yasufumi
eda15f2565 doc: add clear behaviour of list options to Japanese lxc.container.conf(5)
Update for commit ff68914

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-02-01 09:44:17 +01:00
Stéphane Graber
39938b251d Merge pull request #785 from hallyn/2016-01-31/cgfs
2016 01 31/cgfs
2016-01-31 17:56:26 +01:00
Serge Hallyn
3939a22a48 cgfs: prune the init scope from paths
Just as cgmanager does, if we are calculating a task's paths, drop
the trailing '/init.scope'.  We don't want the container to sit under
there.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-01-31 16:34:54 +01:00
Serge Hallyn
79c59e6b77 cgfs: always handle named subsystems by default
Previously, name= controllers would be handled if lxc.cgroup.use=@all,
but not if lxc.cgroup.use was unspecified.  Change that, since you cannot
run systemd in a container without it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-01-31 16:33:30 +01:00
Stéphane Graber
27a72f2faa
Fix syntax error in ko/lxc-ls.sgml.in
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-31 12:15:59 +01:00
Sungbae Yoo
3fce3181e2 doc: Adapt manpage for Korean lxc-ls to new C implementation
Update for commit 37cf83e

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-31 11:39:01 +01:00
Sungbae Yoo
57e1ac96fb doc: Add valueless lxc.cap.drop behaviour to Korean man page
Update for commit 7eff30f

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-31 11:38:59 +01:00
Sungbae Yoo
23faab5d6b doc: Add lxc-copy to Korean/Japanese see_also.sgml.in
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-31 11:38:57 +01:00
Christian Brauner
9f436f51a1 Remove wrong command line arg from help output
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-01-31 11:36:45 +01:00
Stéphane Graber
3a828ee4df Merge pull request #780 from hallyn/2016-01-29/chown
implement chown for cgfs
2016-01-30 01:26:32 +01:00