Commit Graph

4729 Commits

Author SHA1 Message Date
Fabrice Fontaine
c8601571aa Add --enable-gnutls option
Previously HAVE_LIBGNUTLS was never set in config.h even if gnutls was
detected as AC_CHECK_LIB default action-if-found was overriden by
enable_gnutls=yes
This patch adds an --enable-gnutls option and will call AC_CHECK_LIB
with the default action to write HAVE_LIBGNUTLS in config.h

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
2016-12-18 21:42:07 +01:00
Serge Hallyn
8b7ffa302d Merge pull request #1343 from lifupan/master
confile: support the network link string pattern matching
2016-12-16 12:46:32 -06:00
Christian Brauner
7d091d9e96 Merge pull request #1358 from evgeni/no-default-passwords
do not set insecure passwords
2016-12-16 00:16:34 +01:00
Christian Brauner
555fc01aa7 Merge pull request #1357 from evgeni/opensuse-systemd-fixes
OpenSUSE systemd fixes
2016-12-16 00:15:47 +01:00
Evgeni Golov
37fbf44812 do not set insecure passwords
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-12-15 20:04:15 +01:00
Evgeni Golov
62386d9319 lxc-opensuse: rm poweroff.target -> sigpwr.target copy
Given commit 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.

we should stop poking around with sigpwr.target for systemd.

Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-12-15 20:02:10 +01:00
Evgeni Golov
000f7f1c56 don't try to get stuff from /usr/lib/systemd on the host
it might not even be there…

Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-12-15 19:59:13 +01:00
fli
576400e5e0 confile: support the network link string pattern matching
Enable lxc network config support the following type and link:

lxc.network.type = phys
lxc.network.link = eth+

Here, the suffix '+' will trigger a string pattern matching
and when lxc find any network interfaces name prefixed with
"eth" such as "eth0", "eth1", "ethxxxx" and so on, it will
try to move them into the container's namespace; If it didn't
find any matching, it would do nothing for this configure
line.

Signed-off-by: fli <fupan.li@windriver.com>
2016-12-12 18:11:13 -08:00
Christian Brauner
154a741200 Merge pull request #1354 from tsdmgz/leap-422-template
templates: update openSUSE release to 42.2
2016-12-13 00:11:27 +01:00
Christian Brauner
b0a17c4a21 Merge pull request #1352 from evgeni/powerpc
Debian: powerpc and architecture fixes
2016-12-12 22:37:44 +01:00
Terzeus S. Dominguez
e080c49ab0
Remove libgcc_s1 from openSUSE template
Removed libgcc_s1 because it breaks container building for openSUSE.

Related: openSUSE/obs-build#188

Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
2016-12-13 05:01:05 +08:00
Santiago Ruano Rincón
944d1191f3 templates/lxc-debian.in: handle ppc hostarch -> powerpc
Signed-off-by: Santiago Ruano Rincón <santiago@debian.org>
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-12-12 21:26:00 +01:00
Santiago Ruano Rincón
7d4c775a81 templates/lxc-debian.in: Fix typo in calling dpkg with --print-foreign-architectures option
Signed-off-by: Santiago Ruano Rincón <santiago@debian.org>
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-12-12 21:25:09 +01:00
Terzeus S. Dominguez
3ddfde2ad1
Set openSUSE to be unconfined by AppArmor
Uncommented lxc.aa_profile = unconfined. Otherwise, container fails to
start up.

Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
2016-12-13 03:51:18 +08:00
Terzeus S. Dominguez
e783e4bd74
Change openSUSE default release to Leap 42.2
Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
2016-12-13 01:48:53 +08:00
Terzeus S. Dominguez
76a8633817
Update openSUSE template for Leap 42.2
Aside from adding a 42.2 option, $DISTRO comparisons for Leap have been
changed [ exp ] => [[ exp ]] to accomodate pattern matching for future
releases.

Signed-off-by: Terzeus S. Dominguez <tsdmgz@gmail.com>
2016-12-13 01:48:53 +08:00
Stéphane Graber
759e73a56e Merge pull request #1351 from Blub/cleanup/save-errno
conf, attach: save errno across call to close
2016-12-10 19:43:08 +01:00
Wolfgang Bumiller
fad6ef95ff conf, attach: save errno across call to close
Save errno across some calls to close() since it can be
interrupted.

Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
2016-12-10 19:12:02 +01:00
Stéphane Graber
f1f9cbf294 Merge pull request #1346 from brauner/2016-11-08/fix_attach_fd_leak_master
attach: close lsm label file descriptor
2016-12-09 10:37:06 +01:00
Christian Brauner
1d8e5ca2df
attach: close lsm label file descriptor
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-12-08 23:13:11 +01:00
Christian Brauner
0f6bc7aff3 Merge pull request #1344 from FooDeas/fix-getty
templates: fix getty service startup
2016-12-08 14:22:32 +01:00
FooDeas
e95d7a59ca templates: fix getty service startup
Commit bf39edb39e broke the handling of the getty service file with an '@' character in filename. So the startup condition was not fixed.

Because the parameter was quoted with the causal commit, the escaping has to be removed.

Signed-off-by: Andreas Eberlein foodeas@aeberlein.de
2016-12-08 14:03:10 +01:00
Stéphane Graber
27cc1441b0 Merge pull request #1342 from brauner/2016-12-06/fix_printf_lxc_top
tools: account for different architectures
2016-12-06 11:02:44 -05:00
Christian Brauner
9dba726e16
tools: account for different architectures
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-12-06 16:42:28 +01:00
Christian Brauner
862722a2c3 Merge pull request #1341 from attivio/lxc-top-iops
attach batch mode with -b flag which prints csv output with a timestamp
2016-12-06 14:25:32 +01:00
martin
b420058dd3 attach batch mode with -b flag which prints csv output with a timestamp
Signed-off-by: martin <martin@attivio.com>
2016-12-05 15:09:14 -05:00
Christian Brauner
de1d1db19d Merge pull request #1337 from stgraber/master
tests; Don't cause test failures on cleanup errors
2016-12-03 11:29:11 -05:00
Stéphane Graber
f8df61b2b7 Merge pull request #1340 from brauner/2016-12-02/cap_drop_keep_report_better_error
conf: clearly report to either use drop or keep
2016-12-02 14:04:03 -05:00
Christian Brauner
7389ca267f
conf: clearly report to either use drop or keep
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-12-02 19:41:11 +01:00
Christian Brauner
8500665f0f Merge pull request #1338 from Blub/tools-configfile
tools: lxc-start: set configfile after load_config
2016-12-02 10:37:12 -05:00
Wolfgang Bumiller
b586db430b tools: lxc-start: set configfile after load_config
Same change as in 6118210e0a which was missing in lxc-start
and back then is_defined() wasn't being called.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-12-02 14:21:55 +01:00
Stéphane Graber
9c50a5260f tests; Don't cause test failures on cleanup errors
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-12-01 18:34:00 -05:00
Stéphane Graber
aee937d034 Merge pull request #1336 from brauner/2016-11-29/use_clockgettime
state: use async signal safe fun in lxc_wait()
2016-11-29 14:01:39 -05:00
Stéphane Graber
f8110a8991 Merge pull request #1334 from brauner/2016-11-29/correct_date_formatting
log: make sure that date is correctly formatted
2016-11-29 13:34:02 -05:00
Stéphane Graber
f024b7165d Merge pull request #1333 from brauner/2016-11-29/macro_cleanups
tree-wide: random macro cleanups
2016-11-29 13:33:50 -05:00
Stéphane Graber
181df78f26 Merge pull request #1332 from brauner/2016-11-29/fix_possible_hanging_monitord
monitord: close mainloop on exit if we opened it
2016-11-29 13:33:34 -05:00
Christian Brauner
940ef906b4
state: use async signal safe fun in lxc_wait()
gettimeofday() is not async signal safe. So let's switch to clock_gettime() to
be on the safe side.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-29 19:21:46 +01:00
Christian Brauner
5cc0f22d3e
monitord: close mainloop on exit if we opened it
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-29 08:38:20 +01:00
Christian Brauner
9d7468fdd3
log: make sure that date is correctly formatted
- single digit months, days, hours, minutes, and seconds should always be
  preceded by a 0.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-29 07:52:30 +01:00
Christian Brauner
eab15c1ee6
tree-wide: random macro cleanups
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-29 07:29:32 +01:00
Serge Hallyn
258e3e43a8 Merge pull request #1331 from brauner/2016-11-27/use_sec_nanosec_since_epoch
log: drop all timezone conversion functions
2016-11-28 21:24:57 -06:00
Christian Brauner
d86c0d08c4
log: annotate lxc_unix_epoch_to_utc()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-29 01:26:25 +01:00
Christian Brauner
e1378d3591
log: use lxc_unix_epoch_to_utc()
This allows us to generate nice timestamps in a thread-safe manner without
relying on locale touching functions from any libc.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-28 22:22:14 +01:00
Christian Brauner
65a9df895e
log: add lxc_unix_epoch_to_utc()
Converts a unix time Epoch given by a struct timespec to a UTC string useable
in our logging functions. Maybe expanded to allow for more generic formatting.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-28 22:22:12 +01:00
Christian Brauner
c57dbb9658
log: drop all timezone conversion functions
Our log functions need to make extra sure that they are thread-safe. We had
some problems with that before. This especially involves time-conversion
functions. I don't want to find any localtime() or gmtime() functions or
relatives in here. Not even localtime_r() or gmtime_r() or relatives. They all
fiddle with global variables and locking in various libcs. They cause deadlocks
when liblxc is used multi-threaded and no matter how smart you think you are,
you __will__ cause trouble using them.
(As a short example how this can cause trouble: LXD uses forkstart to fork off
a new process that runs the container. At the same time the go runtime LXD
relies on does its own multi-threading thing which we can't control. The
fork()ing + threading then seems to mess with the locking states in these time
functions causing deadlocks.)
The current solution is to be good old unix people and use the Epoch as our
reference point and simply use the seconds and nanoseconds that have past since
then. This relies on clock_gettime() which is explicitly marked MT-Safe with no
restrictions! This way, anyone who is really strongly invested in getting the
actual time the log entry was created, can just convert it for themselves. Our
logging is mostly done for debugging purposes so don't try to make it pretty.
Pretty might cost you thread-safety.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-28 05:27:39 +01:00
Christian Brauner
b07511df5c
utils: add macro __LXC_NUMSTRLEN
This macro can be used to set or allocate a string buffer that can hold any
64bit representable number.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-27 23:41:06 +01:00
Stéphane Graber
1fbb7fae52 Merge pull request #1329 from brauner/2016-11-27/log_signal_error_on_container_stop
lxccontainer: log failure to send sig to init pid
2016-11-27 01:00:55 -05:00
Stéphane Graber
d0f03fd752 Merge pull request #1328 from brauner/2016-11-27/make_running_hooks_async_signal_safe
conf: remove thread-unsafe strsignal + improve log
2016-11-27 00:10:53 -05:00
Christian Brauner
591614a762
lxccontainer: log failure to send sig to init pid
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2016-11-27 06:01:36 +01:00
Stéphane Graber
1e0a00460a Merge pull request #1327 from brauner/2016-11-26/make_lxc_monitord_async_signal_safe
lxc_monitord: make lxc-monitord async signal safe
2016-11-26 22:56:58 -05:00