Commit Graph

4356 Commits

Author SHA1 Message Date
James Cowgill
f53b591652 utils: Add mips signalfd syscall numbers
Signed-off-by: James Cowgill <james410@cowgill.org.uk>
2016-08-18 16:49:05 +01: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
Christian Brauner
061f2b8a2b
Revert "Merge pull request #1103 from brauner/2016-07-27/fix_android_getline"
This reverts commit 2579641608, reversing
changes made to 813d7f1453.

Contrary to what we suspected the android build errors were not caused by
missing wrong relative include paths. Rather, they were caused by autoconf.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-28 10:56:46 +02:00
oc
dac862c015 attach: setns instead of unshare in lxc-attach
lxc-checkpoint will fail because process createdy by lxc-attach has
incorrect cgroup ns. It needs to use "setns" instead of "unshare"
to set cgroup ns.

Signed-off-by: Chen Haiquan <oc@yunify.com>
2016-07-28 09:13:30 +08:00
Stéphane Graber
2579641608 Merge pull request #1103 from brauner/2016-07-27/fix_android_getline
bdev: include own getline function in bdev.h
2016-07-27 12:28:53 -04:00
Christian Brauner
8c2e2e8f53
bdev: include own getline function in bdev.h
Fixes android build error:

bdev/bdev.c: In function 'detect_fs':
bdev/bdev.c:686:2: error: implicit declaration of function 'getline' [-Werror=implicit-function-declaration]
  while (getline(&line, &linelen, f) != -1) {
  ^

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-27 18:10:48 +02:00
Stéphane Graber
813d7f1453 Merge pull request #1101 from sergiusens/pkgconfig-prefix
Add a prefix to the lxc.pc
2016-07-26 05:16:46 -04:00
Sergio Schvezov
758243d8af Add a prefix to the lxc.pc
This allows installing to different locations and using
the lxc.pc to build using the generated includedir and
libdir.

Signed-off-by: Sergio Schvezov <sergio.schvezov@ubuntu.com>
2016-07-26 09:41:47 +02:00
Stéphane Graber
3dad8c43bf Merge pull request #1100 from brauner/2016-07-25/fix_cgfsng_lxcfs_and_cgroupfs_checkfuns
cgfsng: fix is_lxcfs() and is_cgroupfs()
2016-07-25 11:44:28 -04:00
Christian Brauner
2f62fb005b
cgfsng: fix is_lxcfs() and is_cgroupfs()
Both functions advertise that they return true when strncmp() == 0 and false
when strncmp() != 0 but so far they returned the exact opposite.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-25 17:17:39 +02:00
Christian Brauner
9d206b25f5 Merge pull request #1097 from jirutka/patch-1
lxc-alpine: mount tmpfs under /run
2016-07-23 21:31:24 +02:00
Jakub Jirutka
b5caaaa599
lxc-alpine: mount tmpfs under /run
When running under grsecurity kernel or userns, it can't be mounted from inside.

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
2016-07-23 21:26:33 +02:00
Stéphane Graber
5429ec248a Merge pull request #1094 from brauner/2016-07-22/fix_android_lxc_copy
lxc-copy: do not use mkostemp and dprintf
2016-07-22 22:30:50 +02:00
Christian Brauner
a8e279fd53
lxc-copy: do not use mkostemp and dprintf
Fixes android builds:

DSBINDIR=\"/data/lxc/lxc/sbin\"      -I/build/libcap/libcap/include/ -Wall -Werror -MT lxc_copy.o -MD -MP -MF $depbase.Tpo -c -o lxc_copy.o lxc_copy.c &&\
	mv -f $depbase.Tpo $depbase.Po
lxc_copy.c: In function 'mount_tmpfs':
lxc_copy.c:834:2: error: implicit declaration of function 'mkostemp' [-Werror=implicit-function-declaration]
  fd = mkostemp(premount, O_CLOEXEC);
  ^
lxc_copy.c:841:2: error: implicit declaration of function 'dprintf' [-Werror=implicit-function-declaration]
  ret = dprintf(fd, "#! /bin/sh\n"
  ^

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-22 21:59:24 +02:00