Commit Graph

25389 Commits

Author SHA1 Message Date
Michal Sekletar e01ff70a77 nspawn: always setup machine id
We check /etc/machine-id of the container and if it is already populated
we use value from there, possibly ignoring value of --uuid option from
the command line. When dealing with R/O image we setup transient machine
id.

Once we determined machine id of the container, we use this value for
registration with systemd-machined and we also export it via
container_uuid environment variable.

As registration with systemd-machined is done by the main nspawn process
we communicate container machine id established by setup_machine_id from
outer child to the main process by unix domain socket. Similarly to PID
of inner child.
2016-04-11 16:43:16 +02:00
Martin Pitt 710a8858a9 Merge pull request #2985 from keszybz/lldp-assert
Replace if with assert_cc in lldp code and a build-sys tweak
2016-04-08 08:31:33 +02:00
Zbigniew Jędrzejewski-Szmek 74dd72d559 Merge pull request #2943 from vinaykul/systemd_duid_review_fixes
DHCP DUID parsing fix, logging fix, man-page fix
2016-04-07 20:19:19 -04:00
Zbigniew Jędrzejewski-Szmek 3aa131c4ca Merge pull request #2987 from CyberShadow/pull-20160407-234344
core: downgrade warning about duplicate device names again
2016-04-07 20:04:27 -04:00
Vladimir Panteleev 071e0b8b3a core: downgrade warning about duplicate device names again
Pull request #2412 seemed to have unintentionally reverted
5259bcf6a6, thus reintroducing
https://bugs.freedesktop.org/show_bug.cgi?id=90386.

This commit reverts that part of the commit, changing the
log level to debug again.
2016-04-07 23:48:29 +00:00
Zbigniew Jędrzejewski-Szmek c8cf4dc1e5 lldp: replace if with assert_cc
LLDP_TX_HOLD or one of the other variables might be changed in the future
resulting in a silent error here if the if was just removed.

Replacement for #2983.
2016-04-07 14:29:59 -04:00
Zbigniew Jędrzejewski-Szmek 56815242ac build-sys: force generation of triggers.systemd file
We don't want to actually install it anywhere, because it
is only usable copied or %included directly into a spec file,
and must be available before %prep is run. But still, it's
useful to generate it automatically so it's easier to copy
and it doesn't go stale.
2016-04-07 14:29:34 -04:00
Martin Pitt f7152c19b9 Merge pull request #2981 from keszybz/test-nss
build-sys: move test-nss to manual_tests
2016-04-07 17:01:12 +02:00
Zbigniew Jędrzejewski-Szmek b7b61747b0 build-sys: move test-nss to manual_tests 2016-04-07 09:02:12 -04:00
Zbigniew Jędrzejewski-Szmek 3c9117545f Merge pull request #2976 from martinpitt/udev-test-tags
Add tags tests to udev-test.pl
2016-04-06 19:45:24 -04:00
Martin Pitt 817ec8cc81 sd-device: Allocate enough room for tags string
Fix commit 1d88a2: We need to allocate another byte for building the "tags"
string, as we append an extra ':' and still need the NUL terminator.
2016-04-06 23:50:39 +02:00
Martin Pitt bf8f7583ee test: udev: Check tags
Add two more tests:

 - Add a single tag, match on it, don't match on another.
 - Add 10.000 tags to a device, ensure that udev survives this.
   (Reproduces crash fixed by commit 1d88a271a)
2016-04-06 23:30:10 +02:00
Martin Pitt efc9f70325 test: udev: check exit code of test-udev
We expect test-udev to succeed. Verify that its exit code is zero, particularly
to spot crashes (e. g. a segfault would be error code 139).
2016-04-06 23:30:10 +02:00
Lennart Poettering 2f26f83008 Merge pull request #2972 from lnykryn/curl
configure.ac: bump curl dependency to 7.32.0
2016-04-06 18:36:22 +02:00
Lukas Nykryn f0b7fc2d89 configure.ac: bump curl dependency to 7.32.0
We are using CURLOPT_XFERINFOFUNCTION which was added in 7.32.0.
2016-04-06 15:03:31 +02:00
Zbigniew Jędrzejewski-Szmek 7b792fa1a9 Merge pull request #2970 from msekletar/machine-id-prefix-roota
machine-id-setup: simplify by using prefix_roota
2016-04-06 07:58:05 -04:00
Martin Pitt 64af424063 Merge pull request #2971 from torstehu/fix-typo
man: fix spelling mistakes
2016-04-06 12:57:54 +02:00
Torstein Husebø 95f4c7f595 man: fix spelling mistakes 2016-04-06 12:37:01 +02:00
Martin Pitt 600101ca28 Merge pull request #2969 from evverx/udev-test-dont-rely-on-underlying-fs-2
tests: don't rely on the underlying fs in test-udev (v2)
2016-04-06 11:51:38 +02:00
Lennart Poettering 354362c46b Merge pull request #2968 from keszybz/journal-upload-watchdog-update-master
Journal upload watchdog update master
2016-04-06 10:50:46 +02:00
Lennart Poettering d4337c15d5 Merge pull request #2944 from keszybz/man-coredump-sysctl
Man coredump sysctl
2016-04-06 10:49:52 +02:00
Lennart Poettering 056f0498fe Merge pull request #2947 from keszybz/test-nss
Add a test for nss modules and some related fixes
2016-04-06 10:48:55 +02:00
Lennart Poettering 382b56622a Merge pull request #2962 from keszybz/value-option
Add `--value` option to systemctl and loginctl to only print values
2016-04-06 10:47:37 +02:00
Lennart Poettering d35da3ae6a Merge pull request #2961 from evverx/fix-activate-sigchld
activate: improve SIGCHLD handler
2016-04-06 10:46:47 +02:00
Michal Sekletar f5e754e0d7 machine-id-setup: simplify by using prefix_roota 2016-04-06 09:55:24 +02:00
Evgeny Vereshchagin 21d9e3f339 tests: don't rely on the underlying fs in test-udev (v2)
* This reverts commit 646048b40a.
Let's test really big numbers again

* Don't be so brutal: use rmdir instead of rm -rf
As suggested https://github.com/systemd/systemd/pull/2966#issuecomment-205751680
2016-04-06 04:08:39 +00:00
Zbigniew Jędrzejewski-Szmek 82e4c2d656 nss-myhostname: remove dead test of variable that was not set 2016-04-05 23:19:56 -04:00
Zbigniew Jędrzejewski-Szmek 2abb5b3b10 test-nss: test the resolution of various names
nss-dns is also "tested". It should be almost always available,
and provides a reference for comparison.
2016-04-05 23:19:56 -04:00
Zbigniew Jędrzejewski-Szmek 8e98476e14 string-table: split long definitions 2016-04-05 23:19:56 -04:00
Zbigniew Jędrzejewski-Szmek e138e7d7fc machinectl: indentation fix 2016-04-05 23:03:58 -04:00
Zbigniew Jędrzejewski-Szmek 855005230b machinectl: add --value option 2016-04-05 23:03:58 -04:00
Zbigniew Jędrzejewski-Szmek 0c0d058325 Merge pull request #2964 from martinpitt/cgroup-doc-links
man: update links to kernel.org cgroup documentation
2016-04-05 21:09:20 -04:00
Zbigniew Jędrzejewski-Szmek 6dfde7acf1 man: also mention systemd-coredump@.service and systemd-coredump.socket
Added in 3c171f0b1e.
2016-04-05 21:00:10 -04:00
Zbigniew Jędrzejewski-Szmek e8ceb82e21 Merge pull request #2966 from evverx/udev-test-dont-rely-on-underlying-fs
tests: don't rely on underlying fs in udev-test, use tmpfs instead
2016-04-05 20:36:01 -04:00
Zbigniew Jędrzejewski-Szmek 0aa176a751 journal-upload: make watchdog state non-static
Also parse watchdog config when creating the Uploader object.
2016-04-05 20:28:56 -04:00
Klearchos Chaloulos d79ca7a622 journal-upload: Update watchdog while in curl_easy_perform
It is observed that a combination of high log throughput, low I/O speed on journal remote side and many nodes uploading simultaneously caused the journal-upload process to dump core because of watchdog starvation. This is caused because journal-upload stays in curl_easy_perform(), because it cannot upload fast enough to reach the end of the journal. Currently journal-upload will return from curl_easy_perform() only when the end of the journal is reached. Therefore a check is added in journal_input_callback(), which will update the watchdog if the elapsed time since the start of the uploading process is greater than WATCHDOG_USEC/2.
2016-04-05 17:37:00 +03:00
Evgeny Vereshchagin 5488e52d28 activate: improve SIGCHLD handler
* Don't lose children exit codes

* Don't receive notification when child processes stop
Eliminates annoying "Child died"-messages:
$ ./systemd-socket-activate -l 2000 --inetd -a cat
^Z
[1]+  Stopped                 ./systemd-socket-activate -l 2000 --inetd -a cat

$ bg %1
[1]+ ./systemd-socket-activate -l 2000 --inetd -a cat &
Child 15657 died with code 20

$ ps u 15657
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
ubuntu   15657  0.0  0.0   4540   680 pts/2    S    00:34   0:00 cat

* Don't fail to reap some zombie children
Fixes
$ ./systemd-socket-activate -l 2000 --inetd -a cat &
$ for i in {1..1000}; do echo a | nc localhost 2000 & done
$ ps f
...
18235 pts/2    Ss     0:01 -bash
15849 pts/2    S      0:00  \_ ./systemd-socket-activate -l 2000 --inetd
-a cat
16081 pts/2    Z      0:00  |   \_ [cat] <defunct>
16381 pts/2    Z      0:00  |   \_ [cat] <defunct>
and many more zombies
...
2016-04-05 14:34:04 +00:00
Martin Pitt 5e939dd6a4 man: fix cgroup attributes for device throttling 2016-04-05 15:28:47 +02:00
Lennart Poettering 050d7e1998 Merge pull request #2965 from martinpitt/systemctl-polkit
systemctl: don't start polkit agent when running as root
2016-04-05 12:41:36 +02:00
Evgeny Vereshchagin 2ce8d27b1f tests: don't rely on underlying fs in udev-test, use tmpfs instead
Fixes: #457
2016-04-05 10:38:09 +00:00
Martin Pitt 89d0348220 polkit: don't start polkit agent when running as root
On the server side we already bypass the polkit checks if the caller is root
(see the sd_bus_query_sender_privilege() call in bus_verify_polkit_async()). So
there is no reason to invoke polkit when running
systemctl/machinectl/loginctl/timedatectl as root.

Fixes #2748
2016-04-05 12:18:55 +02:00
Lennart Poettering 356a5696b4 Merge pull request #2955 from martinpitt/master
sd-device: fix crash if a device has many tags
2016-04-05 11:27:16 +02:00
Martin Pitt c51fa94772 man: update links to kernel.org cgroup documentation
This recently moved from /cgroups/ to /cgroup-v1/.

Fixes #2958
2016-04-05 10:48:06 +02:00
Martin Pitt 1d88a271a6 sd-device: fix crash if a device has many tags or devlinks
strjoina() is unsafe to be used in an unbounded loop as alloca() has no error
reporting. Thus devices with a large number of tags or devlinks trigger a
segfault in device_properties_prepare() due to overflowing the stack.

Rewrite the building of the "tags" and "devlinks" strings using
GREEDY_REALLOC() and strpcpy() to work with arbitrarily long strings. This also
avoids re-copying the entire string in each loop iteration.

Before this commit we always appended one final ":" to "tags". Change this to
start with an iniital ":" and for each tag append instead of prepend a ":".
This unifies what happens for the first and all subsequent tags so that we can
use a for loop.

Fixes #2954
2016-04-05 08:55:34 +02:00
Vinay Kulkarni f38e0cce75 Drop description of 'Type' field from docs. 2016-04-04 21:06:11 -07:00
Vinay Kulkarni b7f71444c0 Address code-review items for pull-request #2890
1. Replace strtol with unhexchar, verified with valid and invalid DUID strings.
2. Fix logging to use log_syntax instead of log_error.
3. On error reading DUID, ignore read and preserve previous state.
4. Fix man-pages to use markup, remove options not yet implemented.
5. Remove spurious header line in new files.
2016-04-04 21:06:11 -07:00
Zbigniew Jędrzejewski-Szmek f4046fe06f loginctl: add --value option 2016-04-04 22:41:49 -04:00
Zbigniew Jędrzejewski-Szmek 4f9a91055c systemctl: add --value option
With this option, systemctl will only print the rhs in show:
$ systemctl show -p Wants,After systemd-journald --value
systemd-journald.socket ...
systemd-journald-dev-log.socket ...

This is useful in scripts, because the need to call awk or similar
is removed.
2016-04-04 22:41:49 -04:00
Zbigniew Jędrzejewski-Szmek 77384fb0ed Merge pull request #2959 from keszybz/stop-resolving-localdomain
*.localdomain != localhost
2016-04-04 22:06:37 -04:00
David R. Hedges 63003524cb *.localdomain != localhost
".localdomain" is not a reserved suffix (or prefix). I'm not aware of any
product expecting *.localdomain to resolve to localhost, however I am aware of
at least one product that defaults to ".localdomain" as its DNS suffix provided
via DHCP (pfSense). This leads to unexpected results when attempting to access
a host that's offline (or a host that's online, when nsswitch.conf is
[mis-]configured to have myhostname ahead of DNS).

Operate on:
localhost (and localhost.)
*.localhost (and *.localhost.)
localhost.localdomain (and localhost.localdomain.)
*.localhost.localdomain (and *.localhost.localdomain.)

We should not cover:
*.localdomain (nor *.localdomain.)
localdomain (nor localdomain.)
2016-04-04 13:28:57 -04:00