Commit Graph

4368 Commits

Author SHA1 Message Date
Wolfgang Bumiller
71d74a8342 doc: add --rcfile to common opts
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-08-17 16:27:23 +02:00
Wolfgang Bumiller
6118210e0a tools: set configfile after load_config
In order to cause c->is_defined() to become true.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-08-17 16:27:23 +02:00
Wolfgang Bumiller
50b737a3c6 tools: move --rcfile to the common options list
In almost all commands it's a useful addition to the -n
switch which is a common option, too.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-08-17 16:27:23 +02:00
Stéphane Graber
91e7dd57a0 Merge pull request #1134 from brauner/2016-08-16/load_correct_ovl_module
bdev: use correct overlay module name
2016-08-16 22:56:43 +02:00
Christian Brauner
88232d3f4e
bdev: use correct overlay module name
- Assume that the module name is "overlay" per default and not "overlayfs".
- Assume that the overlay version we are using requires a workdir.
- When we mount an overlay filesystem and we fail with ENODEV retry once with
  the module name we haven't already used.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-16 22:24:04 +02:00
Serge Hallyn
acdab4e3e0 Merge pull request #1132 from stgraber/master
Update gitignore
2016-08-15 21:44:29 -05:00
Stéphane Graber
043c8e43b2 Add lxc-test-utils to .gitignore
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-08-15 22:42:45 -04:00
Stéphane Graber
fad06fc561 Fix .gitignore after /tools/ split
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-08-15 22:42:21 -04:00
Stéphane Graber
bcfacb9caa Merge pull request #1131 from brauner/2016-08-16/fix_make_dist
autotools: fix tests
2016-08-16 02:04:19 +02:00
Christian Brauner
0377ef65b4
autotools: fix tests
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-16 01:42:38 +02:00
Serge Hallyn
971bbd5800 Merge pull request #1129 from brauner/2016-08-13/minimal_unit_testing
[RFC] add minimal unit testing for liblxc functions
2016-08-15 12:36:44 -05:00
Christian Brauner
29c57e4ef6
tests: add unit tests for lxc_string_in_array()
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-15 18:27:56 +02:00
Christian Brauner
bed0d08fe7 tests: add unit tests for lxc_string_replace()
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-14 23:15:31 +02:00
Stéphane Graber
b9977146fc Merge pull request #1128 from brauner/2016-08-14/fix_text_file_busy
tools: use fclose() after fdopen() + add newline
2016-08-14 23:03:25 +02:00
Christian Brauner
b44c42e8f0
tools: use fclose() after fdopen() + add newline
So far we accidently used close() on the original file descriptor. (After
fdopen() the original fd is considered private and should not be used anymore.
The close operations should be performed on the new file handle. We did the
correct thing on error but not on success.) Using close() on the original fd
caused "Text file busy" errors and prevented the cloned tmpfs container from
starting.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-14 01:54:32 +02:00
Serge Hallyn
4b281e1264 Merge pull request #1127 from brauner/2016-08-13/add_missing_newline
tools: add missing newline in lxc-create output
2016-08-13 10:21:57 -05:00
Christian Brauner
a7944d2bf1
tools: add missing newline in lxc-create output
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-13 16:04:44 +02:00
Serge Hallyn
cf5a3f4404 Merge pull request #1125 from brauner/2016-08-12/smarter_btrfs_subvol_detection
bdev: be smarter about btrfs subvolume detection
2016-08-12 21:01:31 -05:00
Serge Hallyn
121e90aa9e Merge pull request #1126 from brauner/2016-08-13/fix_runtime_path_for_lxc_ls
tools: use correct runtime path for lxc-ls
2016-08-12 21:00:12 -05:00
Christian Brauner
2263d59596
tools: use correct runtime path for lxc-ls
So far we've simply been using RUNTIME_PATH for the privileged and unprivileged
case. We should actually use XDG_RUNTIME_DIR for the unprivileged case.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-13 00:56:33 +02:00
Christian Brauner
6e0fa6a0c6 bdev: be smarter about btrfs subvolume detection
When a container c is on a btrfs filesystem but is directory backed, copying
the container will default to snapshot. This is because of
should_default_to_snapshot() returning true in this case because c is on a
btrfs filesystem. We should make sure that should_default_to_snapshot() only
returns true, when c itself is a btrfs subvolume.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-13 00:40:17 +02:00
Christian Brauner
6fe1146ddb Merge pull request #1120 from tenforward/update_man
Update English and Japanese lxc-attach(1)
2016-08-12 10:35:43 +02:00
KATOH Yasufumi
c91e90b5bd doc: Update Japanese lxc-attach(1)
* Add undocumented options (-v/--set-var, --keep-var, -f/--rcfile)
* Change order of option in SYNOPSIS (-L that is placed after "command")
* Add long options in SYNOPSIS

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2016-08-12 17:29:55 +09:00
KATOH Yasufumi
03b03982dd doc: Update lxc-attach(1)
* Add undocumented options (-v/--set-var, --keep-var, -f/--rcfile)
* Change order of option in SYNOPSIS (-L that is placed after "command")
* Add long options in SYNOPSIS

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2016-08-12 17:26:31 +09:00
Serge Hallyn
d3488f3706 Merge pull request #1119 from brauner/2016-08-11/fix_log_output
log: fix log_append_stderr()
2016-08-12 00:55:48 -05:00
Christian Brauner
c3ff6e245d
log: fix log_append_stderr()
Log output currently looks like this:

	lxc-copy: debbdev/lxcdir.c: dir_clonepaths: 45 directories cannot be snapshotted.  Try aufs or overlayfs.

we rather want it to be:

	lxc-copy: deb: bdev/lxcdir.c: dir_clonepaths: 45 directories cannot be snapshotted.  Try aufs or overlayfs.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-11 23:51:29 +02:00
Serge Hallyn
e00456c820 Merge pull request #1118 from brauner/2016-08-09/remove_readdir_r
tree-wide: replace readdir_r() with readdir()
2016-08-11 09:25:34 -05:00
Christian Brauner
74f9697663
tree-wide: replace readdir_r() with readdir()
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-08-09 21:10:02 +02:00
Stéphane Graber
baecb85acc Merge pull request #1116 from clandmeter/alpine-aarch64
templates: add support for new arch on Alpine Linux
2016-08-07 16:33:09 +02:00
Carlo Landmeter
12d233d5a3 templates: add support for new arch on Alpine Linux
Signed-off-by: Carlo Landmeter <clandmeter@gmail.com>
2016-08-07 12:42:32 +00:00
Christian Brauner
71634eb320 Merge pull request #1114 from Blub/lxc-attach-f
lxc-attach: add -f option & cleanup
2016-08-05 00:58:24 +02:00
Wolfgang Bumiller
b609774d57 whitespace cleanup
The rest of this block uses spaces instead of tabs already.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-08-04 12:26:14 +02:00
Wolfgang Bumiller
a7ae6ce4e5 add -f option to lxc-attach
Otherwise a container with a non-standard configuration file
can be started but not attached to.
Fixes the following case:
 # lxc-start -n ct -f /different/path/my.config
 # lxc-attach -n ct
 Error: container ct is not defined

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-08-04 12:26:08 +02:00
Christian Brauner
1e7990d77c Merge pull request #1111 from ysbnim/master
doc: Add documentation of lxc.syslog to Korean lxc.container.conf(5)
2016-08-02 10:11:49 +02:00
Sungbae Yoo
df07390b0e doc: Add documentation of lxc.syslog to Korean lxc.container.conf(5)
Update for commit 204dfdf

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-08-02 11:44:12 +09:00
Stéphane Graber
d6101a8f22 Merge pull request #1109 from brauner/2016-07-31/append_to_search_path
partially reorganize repo
2016-08-01 21:05:12 +02:00
Christian Brauner
40292280e6 Merge pull request #1110 from tenforward/japanese
doc: Add documentation of lxc.syslog to Japanese lxc.container.conf(5)
2016-08-01 13:57:24 +02:00
KATOH Yasufumi
917420ddcb doc: Add documentation of lxc.syslog to Japanese lxc.container.conf(5)
and add local6 to valid facility

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2016-08-01 20:46:16 +09:00
Christian Brauner
ca1e6c0227
tools, tests: reorganize repo
- tools: move lxc commands to common subfolder
- tests: adapt include search path

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-31 13:01:03 +02:00
Christian Brauner
8d3b0a65b2
cgroups: move cgroup files to common subfolder
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-31 12:48:10 +02:00
Christian Brauner
d8e4899290
bdev: add subdirectories to search path
This allows us to avoid using relative includes which is cleaner in the long
run when we create subdirectories for other components of liblxc.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-31 12:47:58 +02:00
Christian Brauner
b336ea596b Merge pull request #1105 from bapt/syslog
Add syslog support
2016-07-30 01:23:42 +02:00
Baptiste Daroussin
204dfdf28b Add documentation for the new syslog logging mechanism
Signed-off-by: Baptiste Daroussin <bapt@gandi.net>
2016-07-29 23:31:48 +02:00
Baptiste Daroussin
64c57ea157 Add a new logger: syslog and Print the VM name in the logs
To activate it specify lxc.syslog = <afacility>
For now the available facilities are: daemon, local[0-7] others will be
rejected

syslog got only activated after the function that checks for inheritance
of fd is passed in order to make sure the syslog fd is not inherited
and prevent the creation of the fd is any log have been issued during
the checks (which would end up in an infinite loop)

Signed-off-by: Fatih ACAR <fatih.acar@gandi.net>
Signed-off-by: Ahmed Amamou <ahmed@gandi.net>
Signed-off-by: Baptiste Daroussin <bapt@gandi.net>
Signed-off-by: William Dauchy <william@gandi.net>
2016-07-29 23:31:48 +02:00
Stéphane Graber
4b6d675bf7 Merge pull request #1108 from brauner/2016-07-29/fix_android_part_n
criu: replace tmpnam() with mkstemp()
2016-07-29 08:35:26 +02:00
Christian Brauner
9b1e2e6e2c
criu: replace tmpnam() with mkstemp()
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-29 00:53:53 +02:00
Christian Brauner
c0befcbecd Merge pull request #1106 from Blub/next
conf: set pty_info to NULL after free
2016-07-28 16:52:05 +02:00
Wolfgang Bumiller
e00c024230 conf: set pty_info to NULL after free
This fixes a double free corruption on container-requested
reboots when lxc_spawn() fails before receiving the ttys, as
lxc_fini() (part of __lxc_start()'s cleanup) calls
lxc_delete_tty().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-07-28 15:13:41 +02:00
Christian Brauner
11b09c7aff Merge pull request #1102 from chenhaiq/master
attach: use setns instead of unshare
2016-07-28 13:23:58 +02:00
Stéphane Graber
42cbf5e246 Merge pull request #1104 from brauner/2016-07-27/fix_android_getline
Revert "Merge pull request #1103 from brauner/2016-07-27/fix_android_…
2016-07-28 12:30:27 +02:00