Commit Graph

3873 Commits

Author SHA1 Message Date
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
Stéphane Graber
839c1c77a1 Merge pull request #784 from mingewang/master
increase /dev size to 500k ( issue #781)
2016-01-30 01:25:33 +01:00
Min Wang
c35d29097c increase /dev size to 500k ( issue #781)
Signed-off-by: Min Wang <mingewang@gmail.com>
2016-01-29 16:27:35 -05:00
Stéphane Graber
b9f6d3f088 Merge pull request #777 from hallyn/2016-01-28/cgns1
cgroup ns: move the check for whether cgns is supported
2016-01-29 18:13:32 +01:00
Serge Hallyn
8b2768608d implement chown for cgfs
This allows cgfs to be used to create containers in a user namespace,
and have the container owner be able to use cgroups.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-01-29 17:49:56 +01:00
Stéphane Graber
49dce6ec63 Merge pull request #768 from clopez/ignore_git_directories
Ignore any container named '.git'
2016-01-29 17:16:36 +01:00
Carlos Alberto Lopez Perez
e4ebeab1cd Ignore any container with a name starting by '.'
* This are either '.', '..' or a hidden directory.
    And this names should not be used for a container
    in any case.

  * Before this patch, if you created a git repository under lxc.lxcpath (it
    can be useful to keep track of the configurations of your containers)

    Then, when you run lxc-ls you will get the following output:

        # lxc-ls
        .git      container1      container2    ....

    This is because there is a 'config' file inside the '.git' directory.
    It is where git stores the configuration of the repository.

    And the test lxc-ls does to check if a directory contains a container
    is just to check if the 'directory/config' file exists.

Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
2016-01-29 15:39:22 +01:00
Stéphane Graber
5c698360ff
Add SOCK_CLOEXEC define for Android
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-29 13:35:47 +01:00
Stéphane Graber
a5405bd0b7 Merge pull request #779 from hiraku/fix-centos-template-uppercase
Use ${utsname} instead of ${UTSNAME} because latter variable is not defined
2016-01-29 10:09:49 +01:00
KURODA Hiraku
54a0b57d45 Use ${utsname} instead of ${UTSNAME} because latter variable is not defined.
Signed-off-by: KURODA Hiraku <kuroda@syngram.co.jp>
2016-01-29 18:03:30 +09:00
Stéphane Graber
42caa2482d Merge pull request #740 from kvaidas/master
Template parameter --variant tells debootstrap which variant to use.
2016-01-29 09:55:22 +01:00
Stéphane Graber
4a8f6d012e Merge pull request #772 from nehaljwani/fix-fedora-template-stmt
Fix echo statement inside fedora template
2016-01-29 09:44:13 +01:00
Stéphane Graber
c60646aaa9 Merge pull request #773 from nehaljwani/fix-lxc-create-report
Fix message after {fedora|centos}container creation
2016-01-29 09:43:55 +01:00
Stéphane Graber
dd3cac4081 Merge pull request #774 from Nicop06/patch-1
Fix typo in lxc-archlinux.in
2016-01-29 09:37:52 +01:00
Stéphane Graber
b200f7e721 Merge pull request #778 from hallyn/2016-01-28/usernic
lxc-test-usernic: update to reflect new lxc-test-usernic arguments
2016-01-29 09:37:15 +01:00
Nehal J Wani
95658200a0 Fix echo statement inside fedora template
We no longer use mirrors.kernel.org.
Commit f71e8f4 switched it to archives.fedoraproject.org

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2016-01-29 01:34:04 +05:30
Nehal J Wani
d510d5224b Fix message after {fedora|centos}container creation
If the backingstore is not 'dir', then lxc shouldn't ask the user
to change the password by performing a 'chroot'. Rather, the user
should start, attach, use the passwd command, and then stop the
container.

Fixes #731

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2016-01-29 01:31:30 +05:30
Serge Hallyn
615af4ac3a lxc-test-usernic: update to reflect new lxc-test-usernic arguments
the new lxcpath and lxcname are not optional

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 18:08:50 +01:00
Serge Hallyn
833bf9c2b2 allow cgroupfs mounts under /sys/fs/cgroup
Systemd needs to be able to do these, and it does not bypass
any of our apparmor rules.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 17:49:43 +01:00
Serge Hallyn
fe3c80afc6 cgroup ns: move the check for whether cgns is supported
We have to do it before we join the container's mntns so we have
the host's procdir.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 17:40:06 +01:00
Stéphane Graber
6361a0f2dd
Fix Android build of lxc-ls
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-28 17:08:36 +01:00
Serge Hallyn
c43cbc040b fork off a task to delete ovs ports when done
The new task waits until the container is STOPPED, then asks
openvswitch to delete the port.

This requires two new arguements to be sent to lxc-user-nic.
Since lxc-user-nic ships with lxc, this shouldn't be a problem.

Finally when calling lxc-user-nic, use execlp insteac of execvp
to preserve lxcpath's const-ness.  Technically we are
guaranteed that execvp won't change the args, but it's worth
it to silence the warnings (and not hide real errors).

With this patch, container nics are cleaned up from openvswitch
bridges on shutdown.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-28 15:20:14 +01:00
Stéphane Graber
23c9c64d50
Fix Android build failure
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-01-28 14:53:26 +01:00
Christian Brauner
fa659172a1 lxc-ls: tweak algorithm for ls_has_all_grps()
- With the -g/--groups argument the user can give a comma-separated list of
  groups MUST a container must have in order to be displayed. We receive
  this list as a single string. ls_has_all_grps() is called to check if a
  container has all the groups of MUST in its current list of groups HAS. I.e.
  we determine whether MUST ⊆ HAS and only then do we record the container.
  The original implementation was dumb in that it split the string MUST
  everytime it needed to check whether MUST ⊆ HAS for a given container. That's
  pointless work. Instead we split the string MUST only once in main() and pass
  it to ls_get() which passes it along to ls_has_all_grps().
- Before doing any costly checking make sure that #MUST <= #HAS. If not bail
  immediately.
- The linear search algorithm ls_has_all_grps() currently uses stays for now.
  Binary search et al. do not seem to make sense since sorting the array HAS
  for each container is probably too costly. Especially, since it seems
  unlikely that a users specifies 50+ or so groups on the command line a
  container must have to be displayed. If however there are a lot of use-cases
  where users have a lot of containers each with 50-100 groups and regularly use
  lxc-ls with -g/--groups to only show containers that have 50 specified groups
  among their 50-100 groups we can revisit this issue and implement e.g. binary
  search or a ternary search tree.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 12:33:17 +01:00
Christian Brauner
4763f6cade Restore old behaviour [filter] behaviour
In the Python implementation users could pass a regex without a parameter flag
as additional argument on the command line. The C implementation gained the
flag -r/--regex for this. To not irritate users we restore the old behaviour
and additionally rename -r/--regex to --filter to allow eplicitly passing the
regex.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 12:33:17 +01:00
Christian Brauner
07385df53e lxc-ls: check for ENOMEM and tweaking
- If lxc_container_new() fails we check for ENOMEM and if so goto out. If
  ENOMEM is not set we will simply continue. The same goes for the call to
  regcomp() but instead of checking for ENOMEM we need to check for REG_ESPACE.

- Tweaking: Since lxc-ls might have to gather a lot of containers and I don't
  know if compilers will always optimize this let's move *some* variable
  declarations outside of the loop when it does not hinder readability

- Set ls_nesting to 0 initially. Otherwise users will always see nested
  containers printed.

- ls_get() gains an argument char **lockpath which is a string pointing us to
  the lock we put under /run/lxc/lock/.../... so that we can remove the lock
  when we no longer need it. To avoid pointless memory allocation in each new
  recursion level we share lockpath amongst all non-fork()ing recursive call to
  ls_get().  As it is not guaranteed that realloc() does not do any memory
  moving when newlen == len_lockpath, we give ls_get() an additional argument
  size_t len_lockpath). Every time we have a non-fork()ing recursive call to
  ls_get() we check if newlen > len_lockpath and only then do we
  realloc(*lockpath, newlen * 2) a reasonable chunk of memory (as the path will
  keep growing) and set len_lockpath = newlen * 2 to pass to the next
  non-fork()ing recursive call to ls_get().
  To avoid keeping a variable char *lockpath in main() which serves no purpose
  whatsoever and might be abused later we use a compound literal
  &(char *){NULL} which gives us an anonymous pointer which we can use for
  memory allocation in ls_get() for lockpath. We can conveniently free() it in
  ls_get() when the nesting level parameter lvl == 0 after exiting the loop.
  The advantage is that the variable is only accessible within ls_get() and not
  in main() while at the same time giving us an easy way to share lockpath
  amongst all non-fork()ing recursive calls to ls_get().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 12:33:17 +01:00
Stéphane Graber
a8459b91f6 Revert "lxc-ls: check for ENOMEM and tweaking"
This reverts commit 7f3c1cf27f.
2016-01-28 12:33:00 +01:00
Stéphane Graber
adbc2d3389 Revert "lxc-ls: Restore old [filter] behaviour"
This reverts commit e4434e0fc9.
2016-01-28 12:32:56 +01:00
Christian Brauner
e4434e0fc9 lxc-ls: Restore old [filter] behaviour
In the Python implementation users could pass a regex without a parameter flag
as additional argument on the command line. The C implementation gained the
flag -r/--regex for this. To not irritate users we restore the old behaviour
and additionally rename -r/--regex to --filter to allow eplicitly passing the
regex.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 12:22:21 +01:00
Christian Brauner
7f3c1cf27f lxc-ls: check for ENOMEM and tweaking
- If lxc_container_new() fails we check for ENOMEM and if so goto out. If
  ENOMEM is not set we will simply continue. The same goes for the call to
  regcomp() but instead of checking for ENOMEM we need to check for REG_ESPACE.

- Tweaking: Since lxc-ls might have to gather a lot of containers and I don't
  know if compilers will always optimize this, let's move *some* variable
  declarations outside of the loop when it does not hinder readability.

- Set ls_nesting to 0 initially. Otherwise users will always see nested
  containers printed.

- ls_get() gains an argument char **lockpath which is a string pointing us to
  the lock we put under /run/lxc/lock/.../... so that we can remove the lock
  when we no longer need it. To avoid pointless memory allocation in each new
  recursion level, we share lockpath amongst all non-fork()ing recursive calls
  to ls_get().  As it is not guaranteed that realloc() does not do any memory
  moving when newlen == len_lockpath, we give ls_get() an additional argument
  size_t len_lockpath). Every time we have a non-fork()ing recursive call to
  ls_get() we check if newlen > len_lockpath and only then do we
  realloc(*lockpath, newlen * 2) a reasonable chunk of memory (as the path will
  keep growing) and set len_lockpath = newlen * 2 to pass to the next
  non-fork()ing recursive call to ls_get().
  To avoid keeping a variable char *lockpath in main() which serves no purpose
  whatsoever and might be abused later we use a compound literal
  &(char *){NULL} which gives us an anonymous pointer. This pointer we can use
  for memory allocation in ls_get() for lockpath. We can conveniently free() it
  in ls_get() when the nesting level parameter lvl == 0 after exiting the loop.
  The advantage is that the variable is only accessible within ls_get() and not
  in main() while at the same time giving us an easy way to share lockpath
  amongst all non-fork()ing recursive calls to ls_get().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 12:21:00 +01:00
Christian Brauner
280d23796c update overlayfs and aufs in lxc.container.conf
Explain that multiple /lower layers can be used.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2016-01-28 12:02:23 +01:00