Commit Graph

4488 Commits

Author SHA1 Message Date
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
Stéphane Graber
bdf278a139 Merge pull request #1093 from brauner/2016-07-22/use_priu64
c/r: use PRIu64 format specifier
2016-07-22 17:10:20 +02:00
Christian Brauner
9b945f1320
c/r: use PRIu64 format specifier
Fixes build failures on arm:

criu.c: In function ‘exec_criu’:
criu.c:310:4: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format=]
    ret = sprintf(ghost_limit, "%lu", opts->user->ghost_limit);
    ^
In file included from criu.c:42:0:
log.h:285:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format=]
  struct lxc_log_locinfo locinfo = LXC_LOG_LOCINFO_INIT;  \
         ^
criu.c:312:5: note: in expansion of macro ‘ERROR’
     ERROR("failed to print ghost limit %lu", opts->user->ghost_limit);
     ^

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-22 11:16:43 +02:00
Stéphane Graber
3be6e5ff7c Merge pull request #1092 from LicoMonch/extend-debian-template
simple enhancements of lxc-debian-template-script
2016-07-21 22:50:44 +02:00
Andreas Freudenberg
ade83cbfd1 templates: make shellcheck (Ubuntu: 0.3.7-5 amd64) most possible happy
Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
2016-07-21 00:59:00 +02:00
Andreas Freudenberg
bf39edb39e templates: add more quotes to variables (at least $rootfs should now be covered)
Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
2016-07-21 00:58:49 +02:00
Andreas Freudenberg
e160e45018 templates: avoid noisy perl warnings caused by missing locales
Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
2016-07-21 00:58:19 +02:00
Christian Brauner
5de15f6ade Merge pull request #1091 from ysbnim/master
doc: Update Korean lxc-copy(1) to include tmpfs option
2016-07-20 11:10:25 +02:00
Sungbae Yoo
a84c8ed150 doc: Update Korean lxc-copy(1) to include tmpfs option
Update for commit a361e56

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2016-07-20 18:00:26 +09:00
Christian Brauner
1bb4c7a5cd Merge pull request #1074 from vel21ripn/vlan_mtu
Set up MTU for vlan-type interfaces.
2016-07-20 10:32:36 +02:00
Christian Brauner
0b327c3add Merge pull request #1090 from tenforward/japanese
doc: Update Japanese lxc-copy(1) to include tmpfs option
2016-07-20 10:13:28 +02:00
KATOH Yasufumi
53a92bbcb6 doc: Update Japanese lxc-copy(1) to include tmpfs option
Update for commit a361e56

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2016-07-20 16:03:34 +09:00
Christian Brauner
e4203378cc Merge pull request #1089 from tych0/ghost-limit
c/r: add support for ghost-limit in CRIU
2016-07-20 00:26:30 +02:00
Tycho Andersen
b2b7b0d223 c/r: add support for ghost-limit in CRIU
This is an old option that we probably should have exposed long ago :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
2016-07-19 14:27:26 -06:00
Serge Hallyn
bafda6b63b Merge pull request #1086 from brauner/detect_sigrtmin_3
[RFC]: lxccontainer: detect if we should send SIGRTMIN+3
2016-07-19 12:49:19 -05:00
Christian Brauner
330ae3d350
lxccontainer: detect if we should send SIGRTMIN+3
This is required by systemd to cleanly shutdown. Other init systems should not
have SIGRTMIN+3 in the blocked signals set.

Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-19 16:20:02 +02:00
Serge Hallyn
31c32ef270 Merge pull request #1087 from brauner/2016-07-16/clone_on_tmpfs
lxc-copy: update manpage to include tmpfs option
2016-07-19 08:07:47 -05:00
Christian Brauner
a361e56278
lxc-copy: update manpage to include tmpfs option
Signed-off-by: Christian Brauner <cbrauner@suse.de>
2016-07-19 00:04:10 +02:00
Serge Hallyn
897dcac41f Merge pull request #1084 from brauner/2016-07-16/clone_on_tmpfs
lxc-copy: allow snapshots to be placed on tmpfs
2016-07-18 13:45:50 -05:00