platform/upstream/systemd.git
7 years agocore/killall: add (void)
Zbigniew Jędrzejewski-Szmek [Sun, 19 Feb 2017 18:36:17 +0000 (13:36 -0500)]
core/killall: add (void)

CID #1368238.

7 years agofirewall-util: add an assert that we're not overwriting a buffer
Zbigniew Jędrzejewski-Szmek [Sun, 19 Feb 2017 18:19:50 +0000 (13:19 -0500)]
firewall-util: add an assert that we're not overwriting a buffer

Check for CID #1368267.

7 years agojournalctl: add reference to sd-id128(3) to output (#5382)
Lucas Werkmeister [Sat, 18 Feb 2017 21:36:25 +0000 (22:36 +0100)]
journalctl: add reference to sd-id128(3) to output (#5382)

SD_ID128_MAKE is clearly not a standard C macro, so let’s point the user
to its documentation to let them know which header they need and what
they can then do with MESSAGE_XYZ.

7 years agoman: sd-id128: fix journalctl option name (#5381)
Lucas Werkmeister [Sat, 18 Feb 2017 21:34:28 +0000 (22:34 +0100)]
man: sd-id128: fix journalctl option name (#5381)

--new-id works because it’s an unambiguous prefix, but the full option
name is --new-id128.

7 years agoMerge pull request #5369 from poettering/nspawn-resolved
Zbigniew Jędrzejewski-Szmek [Sat, 18 Feb 2017 16:54:34 +0000 (11:54 -0500)]
Merge pull request #5369 from poettering/nspawn-resolved

fixes for running nspawn+resolved in combination

7 years agounits: order systemd-nspawn@.service after systemd-resolved.service
Lennart Poettering [Thu, 16 Feb 2017 16:57:30 +0000 (17:57 +0100)]
units: order systemd-nspawn@.service after systemd-resolved.service

This way, the nspawn internal check whether resolved is running will
succeed if it is enabled.

Fixes: #4649

7 years agonspawn: tweak check whether resolved is around a bit
Lennart Poettering [Thu, 16 Feb 2017 16:56:10 +0000 (17:56 +0100)]
nspawn: tweak check whether resolved is around a bit

Let's check D-Bus instead of files in /run to see if resolved is
running. This is a bit nicer as bus names are automatically cleaned up
when resolved dies, which is not the case for files in /run.

See: #4649

7 years agounits: enable resolved bus activation though a symlink in /etc
Lennart Poettering [Thu, 16 Feb 2017 16:48:48 +0000 (17:48 +0100)]
units: enable resolved bus activation though a symlink in /etc

The change:
-/usr/lib/systemd/system/dbus-org.freedesktop.resolve1.service
+/etc/systemd/system/dbus-org.freedesktop.resolve1.service

If resolved is disabled, without this, talking to the resolved bus API will
activate it regardless whether it is enabled or not, let's fix that.

7 years agotest: re-drop assumption that /run is a mount point (#5377)
Martin Pitt [Fri, 17 Feb 2017 20:29:02 +0000 (21:29 +0100)]
test: re-drop assumption that /run is a mount point (#5377)

Commit 436e916ea introduced the assumption into test-stat-util that /run
is a tmpfs mount point. This is not the case in build chroots such as
Fedora's mock or Debian's sbuild. So only assert that /run is a tmpfs
and not a btrfs if /run is actually a mount point. This will then still
be asserted with installed tests.

7 years agosystemctl: show extra args if defined (#5379)
Adrián López [Fri, 17 Feb 2017 20:27:45 +0000 (21:27 +0100)]
systemctl: show extra args if defined (#5379)

7 years agoMerge pull request #5373 from poettering/coredump-timestamp-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 20:23:52 +0000 (15:23 -0500)]
Merge pull request #5373 from poettering/coredump-timestamp-fixes

various coredump fixes

7 years agoMerge pull request #5347 from poettering/local-nta
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 20:00:36 +0000 (15:00 -0500)]
Merge pull request #5347 from poettering/local-nta

more resolved fixes

7 years agomissing: add renameat2() definition for 64bit arm (#5378)
Lennart Poettering [Fri, 17 Feb 2017 18:10:09 +0000 (19:10 +0100)]
missing: add renameat2() definition for 64bit arm (#5378)

Following a similar commit in casync:

https://github.com/systemd/casync/pull/10

7 years agoMerge pull request #5275 from ssahani/fix-dropin-net-section
Lennart Poettering [Fri, 17 Feb 2017 17:03:04 +0000 (18:03 +0100)]
Merge pull request #5275 from ssahani/fix-dropin-net-section

networkd: fix drop-in conf directory configs overwriting each other

7 years agoudev: fix id_net_name_path for virtio-ccw interfaces (#5357)
Viktor Mihajlovski [Fri, 17 Feb 2017 15:18:01 +0000 (16:18 +0100)]
udev: fix id_net_name_path for virtio-ccw interfaces (#5357)

The CCW id_net_name_path detection didn't account for virtio
interfaces on the CCW bus. As a result the default interface
names for virtio-ccw interfaces would use the old eth<x>
format instead of enc<busid>.

Since virtio-pci interface naming follows the naming rules
of the parent bus, the names_ccw() logic was changed to apply
the CCW interface naming rules to virtio interfaces as well,
e.g. enc2000 for an interface with a CCW bus id 0.0.2000.
As virtio interfaces are apt to get the otherwise unusual
CCW bus id 0.0.0000, the last '0' is now preserved in this
case.

The virtio subsystem skipping loop has been moved from
names_pci() into a function skip_virtio() that can be reused
for all bus types with virtio network devices.

Since virtio-ccw interfaces use single CCW addresses the ccwgroup
requirement was relaxed and the C definitions were changed
accordingly.

7 years agonetwork: change condition in if testing section presence
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 14:34:25 +0000 (09:34 -0500)]
network: change condition in if testing section presence

section_line and filename should be set together or not at all. Change the
if to test filename, since it's the first of the pair and it seems more natural
to test that.

7 years agonetworkd: immediately transfer ownership of route->section
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 14:26:10 +0000 (09:26 -0500)]
networkd: immediately transfer ownership of route->section

The code was not incorrect previously, but I think it's easier to follow the
ownership (and the code is more likely to remain correct when updated later on),
if freeing of NetworkConfigSection* is immediately made the responsibility of
route_free(), so instead of relying on route_free() not freeing ->section
if adding to the network hashmap failed, make this freeing unconditional.

7 years agoMerge pull request #5333 from poettering/machined-copy-files-userns
Lennart Poettering [Fri, 17 Feb 2017 12:51:58 +0000 (13:51 +0100)]
Merge pull request #5333 from poettering/machined-copy-files-userns

machined userns fixes

7 years agoMerge pull request #5366 from poettering/default-hostname-fix
Lennart Poettering [Fri, 17 Feb 2017 12:51:27 +0000 (13:51 +0100)]
Merge pull request #5366 from poettering/default-hostname-fix

fallback hostname fixes

7 years agoman: document that user namespacing complicates file copies
Lennart Poettering [Thu, 16 Feb 2017 13:38:05 +0000 (14:38 +0100)]
man: document that user namespacing complicates file copies

7 years agocoredump: store the full coredump kernel context in xattrs on the coredump file
Lennart Poettering [Fri, 17 Feb 2017 10:34:29 +0000 (11:34 +0100)]
coredump: store the full coredump kernel context in xattrs on the coredump file

We didn't include the resource limit field, add it.

7 years agocoredump: when reconstructing original kernel coredump context, chop off trailing...
Lennart Poettering [Fri, 17 Feb 2017 10:31:07 +0000 (11:31 +0100)]
coredump: when reconstructing original kernel coredump context, chop off trailing zeroes

Our coredump handler operates on a "context" supplied by the kernel via
the core_pattern arguments. When we pass off a coredump for processing
to coredumpd we pass along enough information for this context to be
reconstructed. This information is passed in the usual journal fields,
and that means we extended the 1s granularity timestamp to 1µs
granularity by appending 6 zeroes. We need to chop them off again when
reconstructing the original kernel context.

Fixes: #4779

7 years agoudevd: use signal_to_string() instead of strsignal() at one place
Lennart Poettering [Fri, 17 Feb 2017 10:18:22 +0000 (11:18 +0100)]
udevd: use signal_to_string() instead of strsignal() at one place

strsignal() sucks, as it tries to generate human readable strings from
something that isn't really human readable by concept. Let's use
signal_to_string() instead, making this more grokkable. Difference is:
SIGINT gets translated → "SIGINT" rather than → "Interrupted".

7 years agocoredump: include signal name in journal metadata
Lennart Poettering [Fri, 17 Feb 2017 10:10:35 +0000 (11:10 +0100)]
coredump: include signal name in journal metadata

(Note that we only do this for the journal metadata, not for the xattrs,
as the xattrs are only supposed to store the original 1:1 info we
acquired from the kernel.)

7 years agocoredump: fix handling of special crashes
Lennart Poettering [Fri, 17 Feb 2017 09:59:21 +0000 (10:59 +0100)]
coredump: fix handling of special crashes

When we encounter a "special" crash we should not continue processing it
the usual way.

7 years agoresolved: try to authenticate SOA on negative replies
Lennart Poettering [Wed, 15 Feb 2017 19:05:27 +0000 (20:05 +0100)]
resolved: try to authenticate SOA on negative replies

For caching negative replies we need the SOA TTL information. Hence,
let's authenticate all auxiliary SOA RRs through DS requests on all
negative requests.

7 years agoresolved: extend various timeouts
Lennart Poettering [Wed, 15 Feb 2017 18:56:59 +0000 (19:56 +0100)]
resolved: extend various timeouts

Let's increase a number of timeouts as they apparently are too short for
some real-world lookups.

See:

https://github.com/systemd/systemd/issues/4003#issuecomment-279842616

In particular we change the following timeouts:

1) The first UDP retry we increase 500ms → 750ms. This is a good idea,
   since some servers need relatively long responses for trivial lookups,
   and giving up our first attempt also has the effect of trying a
   different server for the next attempt which has the side effect that
   we'll run two down-grade iterations in parallel, on both servers.
   Hence, let's give servers a bit more time in the first iteration.

2) Permit 24 retries instead of just 16 per transactions. If we end up
   downgrading all the way down to UDP for a lookup we already need 5
   iterations for that. If we want permit a couple of lost packages for
   each (let's say 4), then we already need 20 iterations.

3) Increase the overall query timeout on the service side to 60s (from
   45s), simply because very long and slow DNSSEC + CNAME chains (such as
   us.ynuf.alipay.com) hit this boundary too easily. The client side
   timeout for the bus method call is increased to 90s, in order to have
   room for the dbus reply to go through

7 years agoresolved: initialize all return values on successful exit of dns_cache_lookup()
Lennart Poettering [Wed, 15 Feb 2017 18:55:34 +0000 (19:55 +0100)]
resolved: initialize all return values on successful exit of dns_cache_lookup()

Following our coding style on success we should initialize all return
parameters of a function. We missed to cases for dns_cache_lookup() (but
covered all others), fix them too.

7 years agoresolved: show rcode in debug output for incoming replies
Lennart Poettering [Wed, 15 Feb 2017 18:54:32 +0000 (19:54 +0100)]
resolved: show rcode in debug output for incoming replies

This is the most important piece of information of replies, hence show
this in the first log message about it.

(Wireshark shows it too in the short summary, hence this definitely
makes sense...)

7 years agoresolved: don't downgrade feature level if we get RCODE on UDP level
Lennart Poettering [Wed, 15 Feb 2017 17:53:25 +0000 (18:53 +0100)]
resolved: don't downgrade feature level if we get RCODE on UDP level

Retrying a transaction via TCP is a good approach for mitigating
packet loss. However, it's not a good away way to fix a bad RCODE if we
already downgraded to UDP level for it. Hence, don't do this.

This is a small tweak only, but shortens the time we spend on
downgrading when a specific domain continously returns a bad rcode.

7 years agoresolved: cache SERVFAIL responses for 30s
Lennart Poettering [Wed, 15 Feb 2017 17:28:23 +0000 (18:28 +0100)]
resolved: cache SERVFAIL responses for 30s

Some domains (such as us.ynuf.alipay.com) almost appear as if they actively
want to sabotage our DNSSEC work. Specifically, they unconditionally
return SERVFAIL on SOA lookups and always only after a 1s delay (at
least). This is pretty bad for our validation logic, as we use SOA
lookups to distuingish zones from non-terminal names. Moreover, SERVFAIL
is an error that is typically returned if we send requests a server
doesn't grok, and thus is reason for us to downgrade our protocol and
try again. In case of these zones this means we'll accept the SERVFAIL
response only after a full iterative downgrade to our lowest feature
level: TCP. In combination with the 1s delays this has the effect of
making us hit our transaction timeout way to easily.

As first attempt to improve the situation: let's start caching SERVFAIL
responses in our cache, after the full downgrade for a short period of
time.

Conceptually this is exposed as "weird rcode" caching, but for now we
only consider SERVFAIL a "weird rcode" worthy of caching. Later on we
might want to add more.

7 years agoresolved: lengthen timeout for TCP transactions
Lennart Poettering [Wed, 15 Feb 2017 17:24:46 +0000 (18:24 +0100)]
resolved: lengthen timeout for TCP transactions

When we are doing a TCP transaction the kernel will automatically resend
all packets for us, there's no need to do that ourselves. Hence:
increase the timeout for TCP transactions substantially, to give the
kernel enough time to connect to the peer, without interrupting it when
we become impatient.

7 years agoresolved: when DNSSEC mode is disabled, don't go beyond EDNS0 feature level
Lennart Poettering [Wed, 15 Feb 2017 15:01:53 +0000 (16:01 +0100)]
resolved: when DNSSEC mode is disabled, don't go beyond EDNS0 feature level

There's no point in talking to a server in DNSSEC mode when we don't
actually want to verify anything.

See: #5352

7 years agoresolved: when accepted a query candidate as final answer, propagate authentication...
Lennart Poettering [Wed, 15 Feb 2017 14:29:05 +0000 (15:29 +0100)]
resolved: when accepted a query candidate as final answer, propagate authentication bool even on failure

Let's make sure that if we accept a query candidate, then let's also
propagate the authenticated flag for it, so that we can properly report
back to the clients whether lookups failed due to non-existance that can
be proven.

7 years agoresolved: propagate AD bit for NXDOMAIN into stub replies
Lennart Poettering [Wed, 15 Feb 2017 14:13:32 +0000 (15:13 +0100)]
resolved: propagate AD bit for NXDOMAIN into stub replies

When we managed to prove non-existance of a name, then we should
properly propagate this to clients by setting the AD bit on NXDOMAIN.

See: #4621

7 years agoresolved: automatically downgrade reply bits on send
Lennart Poettering [Tue, 14 Feb 2017 18:25:47 +0000 (19:25 +0100)]
resolved: automatically downgrade reply bits on send

Doesn't really change anything, but makes things a bit simpler to read.

7 years agoresolved: when the dns server feature level grace period elapses, flush caches
Lennart Poettering [Tue, 14 Feb 2017 17:20:34 +0000 (18:20 +0100)]
resolved: when the dns server feature level grace period elapses, flush caches

The cache might contain all kinds of unauthenticated data that we really
shouldn't be using if we upgrade our feature level and suddenly are able
to get authenticated data again.

Might fix: #4866

7 years agoresolved: fix NSEC proofs for missing TLDs
Lennart Poettering [Tue, 14 Feb 2017 16:54:30 +0000 (17:54 +0100)]
resolved: fix NSEC proofs for missing TLDs

For the wildcard NSEC check we need to generate an "asterisk" domain, by
prepend the common ancestor with "*.". So far we did that with a simple
strappenda() which is fine for most domains, but doesn't work if the
common ancestor is the root domain as we usually write that as "." in
normalized form, and "*." joined with "." is "*.." and not "*." as it
should be.

Hence, use the clean way out, let's just use dns_name_concat() which
only exists precisely for this reason, to properly concatenate labels.

There's a good chance this actually fixes #5029, as this NSEC proof is
triggered by lookups in the TLD "example", which doesn't exist in the
Internet.

7 years agoresolved: make sure configured NTAs affect subdomains too
Lennart Poettering [Tue, 14 Feb 2017 16:28:17 +0000 (17:28 +0100)]
resolved: make sure configured NTAs affect subdomains too

This ensures that configured NTAs exclude not only the listed domain but
also all domains below it from DNSSEC validation -- except if a positive
trust anchor is defined below (as suggested by RFC7647, section 1.1)

Fixes: #5048

7 years agomachined: refuse bind mounts on containers that have user namespaces applied
Lennart Poettering [Thu, 16 Feb 2017 12:59:13 +0000 (13:59 +0100)]
machined: refuse bind mounts on containers that have user namespaces applied

As the kernel won't map the UIDs this is simply not safe, and hence we
should generate a clean error and refuse it.

We can restore this feature later should a "shiftfs" become available in
the kernel.

7 years agomachined: properly propagate long-running operation errors
Lennart Poettering [Mon, 13 Feb 2017 18:39:31 +0000 (19:39 +0100)]
machined: properly propagate long-running operation errors

Actually initialize the "error" structure with the error we got

7 years agomachined: when copying files from/to userns containers chown to root
Lennart Poettering [Mon, 13 Feb 2017 18:24:01 +0000 (19:24 +0100)]
machined: when copying files from/to userns containers chown to root

This changes the file copy logic of machined to set the UID/GID of all
copied files to 0 if the host and container do not share the same user
namespace.

Fixes: #4078

7 years agocopy: change the various copy_xyz() calls to take a unified flags parameter
Lennart Poettering [Mon, 13 Feb 2017 18:00:22 +0000 (19:00 +0100)]
copy: change the various copy_xyz() calls to take a unified flags parameter

This adds a unified "copy_flags" parameter to all copy_xyz() function
calls, replacing the various boolean flags so far used. This should make
many invocations more readable as it is clear what behaviour is
precisely requested. This also prepares ground for adding support for
more modes later on.

7 years agomachinectl: tweak address output in "machinectl status"
Lennart Poettering [Mon, 13 Feb 2017 16:23:58 +0000 (17:23 +0100)]
machinectl: tweak address output in "machinectl status"

With this change we'll not show an "Addresses" field for machines that
we don't know any addresses for.

This changes print_addresses() to never suffix its output with a
newline, leaving that to the caller. That's a good idea since depending
on who the caller is, different rules apply: if no addresses are found,
then the list view still wants a newline, but the status view does not.

This also changes the function to return the number of found addresses,
which can be used to decide when to add a newline or not.

7 years agomachined: expose "UID shift" concept for containers
Lennart Poettering [Fri, 10 Feb 2017 18:44:09 +0000 (19:44 +0100)]
machined: expose "UID shift" concept for containers

UID/GID mapping with userns can be arbitrarily complex. Let's break this
down to a single admin-friendly parameter: let's expose the UID/GID
shift of a container via a new bus call for each container, and let's
show this as part of "machinectl status" if it is not 0.

This should work for pretty much all real-life full OS container setups
(i.e. the stuff machined is suppose to be useful for).  For everything
else we generate a clean error, clarifying that we can't expose the
mapping.

7 years agoresolved: default to the compile-time fallback hostname
Lennart Poettering [Thu, 16 Feb 2017 11:04:51 +0000 (12:04 +0100)]
resolved: default to the compile-time fallback hostname

This changes resolved to use the compile-time fallback hostname the
configured one is not set. Note that if the local hostname is set to
"localhost" then we'll instead default to "linux" here, as for
mDNS/LLMNR exposing "localhost" is actively dangerous.

7 years agocore: when booting up, initialize hostname to compile-time fallback hostname
Lennart Poettering [Thu, 16 Feb 2017 11:03:39 +0000 (12:03 +0100)]
core: when booting up, initialize hostname to compile-time fallback hostname

When /etc/hostname isn't set, default to the configured compile-time
fallback hostname instead of "localhost" for the kernel hostname.

7 years agohostname-util: default to the compile time default hostname in gethostname_malloc()
Lennart Poettering [Thu, 16 Feb 2017 11:02:17 +0000 (12:02 +0100)]
hostname-util: default to the compile time default hostname in gethostname_malloc()

Currently, if the hostname is not set gethostname_malloc() defaults to
the "sysname", which is "linux" on Linux. Let's change that to also
honour the compile-time fallback hostname as specified on the configure
command line.

7 years agoMerge pull request #5338 from mbiebl/fix-install-tests-target
Evgeny Vereshchagin [Fri, 17 Feb 2017 08:38:23 +0000 (11:38 +0300)]
Merge pull request #5338 from mbiebl/fix-install-tests-target

Fix "make install-tests" when srcdir != builddir, fix valgrind-tests

7 years agoExport NVMe WWID udev attribute (#5348)
Keith Busch [Fri, 17 Feb 2017 07:46:06 +0000 (00:46 -0700)]
Export NVMe WWID udev attribute (#5348)

We need this for multipath support without relying on NVMe to SCSI
translations.

Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agovirt: Update cache if the detected vm is virtualbox (#5364)
Benjamin Robin [Fri, 17 Feb 2017 07:45:30 +0000 (08:45 +0100)]
virt: Update cache if the detected vm is virtualbox (#5364)

7 years agoman: mention machines.target in systemd.special(7) (#5371)
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 07:44:26 +0000 (02:44 -0500)]
man: mention machines.target in systemd.special(7) (#5371)

Also sort <refsynopsisdiv>.

7 years agobuild-sys: drop now-unneeded $SYSTEMD_TEST_DATA when running tests
Zbigniew Jędrzejewski-Szmek [Fri, 17 Feb 2017 04:00:03 +0000 (23:00 -0500)]
build-sys: drop now-unneeded $SYSTEMD_TEST_DATA when running tests

7 years agotest: drop TEST_DATA_DIR, fold into get_testdata_dir()
Martin Pitt [Wed, 15 Feb 2017 22:37:25 +0000 (23:37 +0100)]
test: drop TEST_DATA_DIR, fold into get_testdata_dir()

Drop the TEST_DATA_DIR macro as this was using alloca() within a
function call which is allegedly unsafe. So add a "suffix" argument to
get_testdata_dir() instead and call that directly.

7 years agotest: show error message if $SYSTEMD_TEST_DATA does not exist
Martin Pitt [Wed, 15 Feb 2017 07:52:17 +0000 (08:52 +0100)]
test: show error message if $SYSTEMD_TEST_DATA does not exist

Rename get_exe_relative_testdata_dir() to get_testdata_dir() and move
the env var check into that, so that everything interesting happens at
the same place.

7 years agotests: look for tests relative to source dir when running from build dir
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 00:43:51 +0000 (19:43 -0500)]
tests: look for tests relative to source dir when running from build dir

automake helpfully sets a few variables for during build. When our executable
is in a directory underneath $(abs_top_builddir), we know that we're in the
build environment $(abs_top_srcdir) contains the sources, and test data is
under $(abs_top_srcdir)/test. This remains true no matter where the build
directory is relative to the source directory. It also works if the test
executable is invoked as ./test-whatever or .libs/test-whatever, since the
relative path is not used at all.

When running from outside of the build directory, we should be running from the
installed location and we can look for ../testdata relative to the location of
the exe file.

Of course, $SYSTEMD_TEST_DATA always overrides this logic.

7 years agoRename $TEST_DIR to $SYSTEMD_TEST_DATA, document it
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 00:17:38 +0000 (19:17 -0500)]
Rename $TEST_DIR to $SYSTEMD_TEST_DATA, document it

TEST_DIR is rather generic, and we prefix all variables used by installed
executables with "SYSTEMD_".

7 years agotest: setup test data dir before fake runtime dir
Martin Pitt [Tue, 14 Feb 2017 21:33:52 +0000 (22:33 +0100)]
test: setup test data dir before fake runtime dir

That way, if the test directory does not exist we don't leave behind
temporary files (as in that case or on test failure the cleanup actions
don't run).

7 years agotest: clarify error message if test data directory does not exist
Martin Pitt [Tue, 14 Feb 2017 07:58:19 +0000 (08:58 +0100)]
test: clarify error message if test data directory does not exist

When trying to directly run a test executable in the build tree without
setting $TEST_DIR, some tests fail with a non-obvious error message.
Print an useful one instead.

7 years agotest: run valgrind-tests under $TESTS_ENVIRONMENT
Martin Pitt [Tue, 14 Feb 2017 07:47:29 +0000 (08:47 +0100)]
test: run valgrind-tests under $TESTS_ENVIRONMENT

Otherwise we are missing $TEST_DIR for the test data and run the test
against the system-installed binaries and keyboard/locale maps.

7 years agobuild-sys: fix "make install-tests" when srcdir != builddir
Michael Biebl [Tue, 14 Feb 2017 04:38:51 +0000 (05:38 +0100)]
build-sys: fix "make install-tests" when srcdir != builddir

Follow-up for 4f8425b8d5a3fb2e5ec24b77f1a7a95db55f532c

7 years agoMerge pull request #5370 from evverx/fix-test-journal-importer
Martin Pitt [Thu, 16 Feb 2017 20:35:13 +0000 (21:35 +0100)]
Merge pull request #5370 from evverx/fix-test-journal-importer

build-sys: treat journal-data/journal-[12].txt as TEST_DATA_FILES

7 years agonss: fix error to ERANGE for nss calls with too little buffer space (#5365)
Lennart Poettering [Thu, 16 Feb 2017 20:29:09 +0000 (21:29 +0100)]
nss: fix error to ERANGE for nss calls with too little buffer space (#5365)

This is a follow-up for #5359, fixing the error codes in a similar way
for the other NSS modules.

(user/group lookup calls don't have h_errnop, hence we don't update that
in those cases)

7 years agobuild-sys: add exec-privatedevices-[yes|no]-capability-sys-rawio to TEST_DATA_FILES
Evgeny Vereshchagin [Thu, 16 Feb 2017 19:28:17 +0000 (19:28 +0000)]
build-sys: add exec-privatedevices-[yes|no]-capability-sys-rawio to TEST_DATA_FILES

This is a follow-up for 625d8769fa6394a30

7 years agobuild-sys: treat journal-data/journal-[12].txt as TEST_DATA_FILES
Evgeny Vereshchagin [Thu, 16 Feb 2017 19:17:19 +0000 (19:17 +0000)]
build-sys: treat journal-data/journal-[12].txt as TEST_DATA_FILES

Fixes:
```
Found container virtualization none.
Assertion 'imp.fd >= 0' failed at ../src/test/test-journal-importer.c:43, function test_basic_parsing(). Aborting.
FAIL: test-journal-importer (code: 134)
```
See https://github.com/systemd/systemd/pull/5366#issuecomment-280353804

7 years agohwdb update
Lennart Poettering [Thu, 16 Feb 2017 17:15:55 +0000 (18:15 +0100)]
hwdb update

7 years agoMerge pull request #4526 from keszybz/coredump-python
Lennart Poettering [Thu, 16 Feb 2017 10:24:03 +0000 (11:24 +0100)]
Merge pull request #4526 from keszybz/coredump-python

Collect interpreter backtraces in systemd-coredump

7 years agolibsystemd-network: ipv4ll probe conflict counter (#5361)
Jason Reeder [Thu, 16 Feb 2017 10:14:38 +0000 (04:14 -0600)]
libsystemd-network: ipv4ll probe conflict counter (#5361)

A bug exists where the conflict counter is cleared
regardless of whether or not the next probe attempt leads to
a successful address acquisition. This causes 'bursts' of
MAX_CONFLICTS probes followed by a delay of
RATE_LIMIT_INTERVAL instead of a single probe each
RATE_LIMIT_INTERVAL when beyond MAX_CONFLICTS.

The conflict counter should only be cleared after an
address is successfully acquired. This commit achieves that
goal.

From RFC3927:
A host should maintain a counter of the number of address
conflicts it has experienced in the process of trying to
acquire an address, and if the number of conflicts exceeds
MAX_CONFLICTS then the host MUST limit the rate at which it
probes for new addresses to no more than one new address per
RATE_LIMIT_INTERVAL.  This is to prevent catastrophic ARP
storms in pathological failure cases, such as a rogue host
that answers all ARP probes, causing legitimate hosts to go
into an infinite loop attempting to select a usable address.

Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
7 years agonss-resolve: Fix assertion in ifindex_to_scopeid. (#5360)
Maarten de Vries [Thu, 16 Feb 2017 10:00:49 +0000 (11:00 +0100)]
nss-resolve: Fix assertion in ifindex_to_scopeid. (#5360)

7 years agonss-resolve: report ERANGE for small buffers. (#5359)
Maarten de Vries [Thu, 16 Feb 2017 09:52:04 +0000 (10:52 +0100)]
nss-resolve: report ERANGE for small buffers. (#5359)

The correct error code to report when a provided buffer is too small is
ERANGE. This is recognized by glibc, which will then try again with a
larger buffer. The old behaviour of reporting ENOMEM has no special
meaning for glibc. The error will simply be propagated to the
application, and a later retry will trigger the same error again.

Additionally, h_errnop must be set to NETDB_INTERNAL to have glibc look
at errnop for details.

More information at:
https://www.gnu.org/software/libc/manual/html_node/NSS-Modules-Interface.html

7 years agonetworkd: fix drop-in conf directory configs overwriting each other
Susant Sahani [Wed, 15 Feb 2017 04:30:35 +0000 (10:00 +0530)]
networkd: fix drop-in conf directory configs overwriting each other

Now we track the sections for example [Address] via line number.
Which was fine till we din't had dropins dir. If we have multiple
sections which have the ideantical line number in diffrent files
we are overwriting these since line number is the key.

This patch fixes this by taking filename and line number as key.
This fixes [Address] and [Route] section overwriting.

fixes: #5141

7 years agovirt: swap order of cpuid and dmi again, but properly detect oracle (#5355)
Christian Hesse [Wed, 15 Feb 2017 22:51:31 +0000 (23:51 +0100)]
virt: swap order of cpuid and dmi again, but properly detect oracle (#5355)

This breaks again, this time for setups where Qemu is not reported via DMI for whatever
reason. So swap order of cpuid and dmi again, but properly detect oracle.

See issue #5318.

7 years agotest-ipcrm: use configured nobody user name (#5350)
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 09:22:22 +0000 (04:22 -0500)]
test-ipcrm: use configured nobody user name (#5350)

"nfsnobody" is now obsolete.

7 years agocoredump: add note about lack of rollback on oom
Zbigniew Jędrzejewski-Szmek [Mon, 16 Jan 2017 01:25:35 +0000 (20:25 -0500)]
coredump: add note about lack of rollback on oom

7 years agocoredumpctl: display non-coredump coredump entries too
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 18:34:31 +0000 (13:34 -0500)]
coredumpctl: display non-coredump coredump entries too

$ ./coredumpctl --no-pager -1
TIME                            PID   UID   GID SIG COREFILE EXE
Sun 2016-11-06 10:10:51 EST   29514  1002  1002   - -        /usr/bin/python3.5

$ ./coredumpctl info 29514
           PID: 29514 (python3)
           UID: 1002 (zbyszek)
           GID: 1002 (zbyszek)
        Reason: ZeroDivisionError
     Timestamp: Sun 2016-11-06 10:10:51 EST (3h 22min ago)
  Command Line: python3 systemd_coredump_exception_handler.py
    Executable: /usr/bin/python3.5
 Control Group: /user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
          Unit: user@1002.service
     User Unit: gnome-terminal-server.service
         Slice: user-1002.slice
     Owner UID: 1002 (zbyszek)
       Boot ID: 1531fd22ec84429e85ae888b12fadb91
    Machine ID: 519a16632fbd4c71966ce9305b360c9c
      Hostname: laptop
       Storage: none
       Message: Process 29514 (systemd_coredump_exception_handler.py) of user zbyszek failed with ZeroDivisionError: division by

                Traceback (most recent call last):
                  File "systemd_coredump_exception_handler.py", line 134, in <module>
                    g()
                  File "systemd_coredump_exception_handler.py", line 133, in g
                    f()
                  File "systemd_coredump_exception_handler.py", line 131, in f
                    div0 = 1 / 0
                ZeroDivisionError: division by zero

                Local variables in innermost frame:
                  a=3
                  h=<function f at 0x7efdc14b6ea0>

7 years agotree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 17:48:23 +0000 (12:48 -0500)]
tree-wide: add SD_ID128_MAKE_STR, remove LOG_MESSAGE_ID

Embedding sd_id128_t's in constant strings was rather cumbersome. We had
SD_ID128_CONST_STR which returned a const char[], but it had two problems:
- it wasn't possible to statically concatanate this array with a normal string
- gcc wasn't really able to optimize this, and generated code to perform the
  "conversion" at runtime.
Because of this, even our own code in coredumpctl wasn't using
SD_ID128_CONST_STR.

Add a new macro to generate a constant string: SD_ID128_MAKE_STR.
It is not as elegant as SD_ID128_CONST_STR, because it requires a repetition
of the numbers, but in practice it is more convenient to use, and allows gcc
to generate smarter code:

$ size .libs/systemd{,-logind,-journald}{.old,}
   text    data     bss     dec     hex filename
1265204  149564    4808 1419576  15a938 .libs/systemd.old
1260268  149564    4808 1414640  1595f0 .libs/systemd
 246805   13852     209  260866   3fb02 .libs/systemd-logind.old
 240973   13852     209  255034   3e43a .libs/systemd-logind
 146839    4984      34  151857   25131 .libs/systemd-journald.old
 146391    4984      34  151409   24f71 .libs/systemd-journald

It is also much easier to check if a certain binary uses a certain MESSAGE_ID:

$ strings .libs/systemd.old|grep MESSAGE_ID
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
MESSAGE_ID=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x

$ strings .libs/systemd|grep MESSAGE_ID
MESSAGE_ID=c7a787079b354eaaa9e77b371893cd27
MESSAGE_ID=b07a249cd024414a82dd00cd181378ff
MESSAGE_ID=641257651c1b4ec9a8624d7a40a9e1e7
MESSAGE_ID=de5b426a63be47a7b6ac3eaac82e2f6f
MESSAGE_ID=d34d037fff1847e6ae669a370e694725
MESSAGE_ID=7d4958e842da4a758f6c1cdc7b36dcc5
MESSAGE_ID=1dee0369c7fc4736b7099b38ecb46ee7
MESSAGE_ID=39f53479d3a045ac8e11786248231fbf
MESSAGE_ID=be02cf6855d2428ba40df7e9d022f03d
MESSAGE_ID=7b05ebc668384222baa8881179cfda54
MESSAGE_ID=9d1aaa27d60140bd96365438aad20286

7 years agocoredumpctl: just use argv instead of building a temporary set
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 16:29:31 +0000 (11:29 -0500)]
coredumpctl: just use argv instead of building a temporary set

No functional change, and we don't lose match order.

7 years agoman: describe systemd-coredump --backtrace
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 15:48:15 +0000 (10:48 -0500)]
man: describe systemd-coredump --backtrace

7 years agocoredump: with --backtrace accept a journal entry on stdin
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 15:06:32 +0000 (10:06 -0500)]
coredump: with --backtrace accept a journal entry on stdin

The entry must be a single entry in the journal export format, including the
terminating double newline. The MESSAGE field is now generated on the sender
side.

The advantage is that the reporter can easily pass additional metadata.
Continuing with the example of the python excepthook:

COREDUMP_PYTHON_EXECUTABLE=/usr/bin/python3
COREDUMP_PYTHON_VERSION=3.5.2 (default, Sep 14 2016, 11:28:32)
                        [GCC 6.2.1 20160901 (Red Hat 6.2.1-1)]
COREDUMP_PYTHON_THREAD_INFO=sys.thread_info(name='pthread', lock='semaphore', version='NPTL 2.24')
COREDUMP_PYTHON_EXCEPTION_TYPE=ZeroDivisionError
COREDUMP_PYTHON_EXCEPTION_VALUE=division by zero
MESSAGE=Process 29514 (systemd_coredump_exception_handler.py) of user zbyszek failed with ZeroDivisionError: division by zero

        Traceback (most recent call last):
          File "systemd_coredump_exception_handler.py", line 134, in <module>
            g()
          File "systemd_coredump_exception_handler.py", line 133, in g
            f()
          File "systemd_coredump_exception_handler.py", line 131, in f
            div0 = 1 / 0
        ZeroDivisionError: division by zero

        Local variables in innermost frame:
          a=3
          h=<function f at 0x7efdc14b6ea0>

One consideration is whether to use the Journal Export Format, or send packets
over a UNIX socket instead. The advantage of current solution is that although
parsing is more complicated on the receiver side, it is much easier to use on the
sender side. I hope this can be used by various languages for which writing
binary structures to a UNIX socket is harder and more likely to be done wrong
than piping of a simple textyish format.

7 years agotest-journal-importer: add a test case with broken input
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 05:01:17 +0000 (01:01 -0400)]
test-journal-importer: add a test case with broken input

7 years agotest-journal-importer: new test file to check the newly exported importer code
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 03:27:00 +0000 (23:27 -0400)]
test-journal-importer: new test file to check the newly exported importer code

Only one test case is added, but it is enough to check basic sanity of the
code (single-line and binary fields and trusted fields, allocation and freeing).

7 years agoMove export format parsing from src/journal-remote/ to src/basic/
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 02:40:54 +0000 (22:40 -0400)]
Move export format parsing from src/journal-remote/ to src/basic/

No functional change.

7 years agocoredump: implement logging of external backtraces with --backtrace
Zbigniew Jędrzejewski-Szmek [Mon, 31 Oct 2016 02:42:44 +0000 (22:42 -0400)]
coredump: implement logging of external backtraces with --backtrace

This is useful for example for Python progams. By installing a python
sys.execepthook we can store the backtrace in the journal. We gather the
backtrace in the python process, and call systemd-coredump to attach additional
fields (COREDUMP_COMM, COREDUMP_EXE, COREDUMP_UNIT, COREDUMP_USER_UNIT,
COREDUMP_OWNER_UID, COREDUMP_SLICE, COREDUMP_CMDLINE, COREDUMP_CGROUP,
COREDUMP_OPEN_FDS, COREDUMP_PROC_STATUS, COREDUMP_PROC_MAPS,
COREDUMP_PROC_LIMITS, COREDUMP_PROC_MOUNTINFO, COREDUMP_CWD, COREDUMP_ROOT,
COREDUMP_ENVIRON, COREDUMP_CONTAINER_CMDLINE). This could also be done in the
python process, but doing this in systemd-coredump saves quite a bit of
duplicate work and unifies the handling of various tricky fields like
COREDUMP_CONTAINER_CMDLINE in one place.

(Of course this applies to any other language which does not dump cores
but wants to log a traceback, e.g. ruby.)

journal entry:
    _TRANSPORT=journal
    _UID=1002
    _GID=1002
    _CAP_EFFECTIVE=0
    _AUDIT_LOGINUID=1002
    _SYSTEMD_OWNER_UID=1002
    _SYSTEMD_SLICE=user-1002.slice
    _SYSTEMD_USER_SLICE=-.slice
    _SELINUX_CONTEXT=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
    _BOOT_ID=1531fd22ec84429e85ae888b12fadb91
    _MACHINE_ID=519a16632fbd4c71966ce9305b360c9c
    _HOSTNAME=laptop
    _AUDIT_SESSION=1
    _SYSTEMD_UNIT=user@1002.service
    _SYSTEMD_INVOCATION_ID=3c4238d790a44aca9576ecdb2c7576d3
    COREDUMP_UNIT=user@1002.service
    COREDUMP_USER_UNIT=gnome-terminal-server.service
    COREDUMP_UID=1002
    COREDUMP_GID=1002
    COREDUMP_OWNER_UID=1002
    COREDUMP_SLICE=user-1002.slice
    COREDUMP_CGROUP=/user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
    COREDUMP_PROC_LIMITS=Limit                     Soft Limit           Hard Limit           Units
                         Max cpu time              unlimited            unlimited            seconds
                         Max file size             unlimited            unlimited            bytes
                         Max data size             unlimited            unlimited            bytes
                         Max stack size            8388608              unlimited            bytes
                         Max core file size        unlimited            unlimited            bytes
                         Max resident set          unlimited            unlimited            bytes
                         Max processes             15413                15413                processes
                         Max open files            4096                 4096                 files
                         Max locked memory         65536                65536                bytes
                         Max address space         unlimited            unlimited            bytes
                         Max file locks            unlimited            unlimited            locks
                         Max pending signals       15413                15413                signals
                         Max msgqueue size         819200               819200               bytes
                         Max nice priority         0                    0
                         Max realtime priority     0                    0
                         Max realtime timeout      unlimited            unlimited            us
    COREDUMP_PROC_CGROUP=1:name=systemd:/
                         0::/user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
    COREDUMP_PROC_MOUNTINFO=17 39 0:17 / /sys rw,nosuid,nodev,noexec,relatime shared:6 - sysfs sysfs rw,seclabel
                            18 39 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:5 - proc proc rw
                            19 39 0:6 / /dev rw,nosuid shared:2 - devtmpfs devtmpfs rw,seclabel,size=1972980k,nr_inodes=493245,mode=755
                            20 17 0:18 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:7 - securityfs securityfs rw
                            21 19 0:19 / /dev/shm rw,nosuid,nodev shared:3 - tmpfs tmpfs rw,seclabel
                            22 19 0:20 / /dev/pts rw,nosuid,noexec,relatime shared:4 - devpts devpts rw,seclabel,gid=5,mode=620,ptmxmode=000
                            23 39 0:21 / /run rw,nosuid,nodev shared:12 - tmpfs tmpfs rw,seclabel,mode=755
                            24 17 0:22 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime shared:8 - cgroup2 cgroup rw
                            25 17 0:23 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:9 - pstore pstore rw,seclabel
                            36 17 0:24 / /sys/kernel/config rw,relatime shared:10 - configfs configfs rw
                            39 0 0:26 /root / rw,relatime shared:1 - btrfs /dev/mapper/fedora-root2 rw,seclabel,ssd,space_cache,subvolid=257,subvol=/root
                            26 17 0:16 / /sys/fs/selinux rw,relatime shared:11 - selinuxfs selinuxfs rw
                            27 19 0:15 / /dev/mqueue rw,relatime shared:13 - mqueue mqueue rw,seclabel
                            28 18 0:30 / /proc/sys/fs/binfmt_misc rw,relatime shared:14 - autofs systemd-1 rw,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13663
                            29 17 0:7 / /sys/kernel/debug rw,relatime shared:15 - debugfs debugfs rw,seclabel
                            30 19 0:31 / /dev/hugepages rw,relatime shared:16 - hugetlbfs hugetlbfs rw,seclabel
                            31 18 0:32 / /proc/fs/nfsd rw,relatime shared:17 - nfsd nfsd rw
                            32 28 0:33 / /proc/sys/fs/binfmt_misc rw,relatime shared:18 - binfmt_misc binfmt_misc rw
                            57 39 0:34 / /tmp rw,relatime shared:19 - tmpfs none rw,seclabel
                            61 57 0:35 / /tmp/test rw,relatime shared:20 - autofs systemd-1 rw,fd=48,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18251
                            59 39 8:1 / /boot rw,relatime shared:21 - ext4 /dev/sda1 rw,seclabel,data=ordered
                            60 39 253:2 / /home rw,relatime shared:22 - ext4 /dev/mapper/fedora-home rw,seclabel,data=ordered
                            65 39 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime shared:23 - rpc_pipefs sunrpc rw
                            136 23 0:39 / /run/user/1002 rw,nosuid,nodev,relatime shared:91 - tmpfs tmpfs rw,seclabel,size=397432k,mode=700,uid=1002,gid=1002
                            211 23 0:41 / /run/user/42 rw,nosuid,nodev,relatime shared:163 - tmpfs tmpfs rw,seclabel,size=397432k,mode=700,uid=42,gid=42
                            329 136 0:44 / /run/user/1002/gvfs rw,nosuid,nodev,relatime shared:277 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1002,group_id=1002
                            287 61 253:3 / /tmp/test rw,relatime shared:236 - ext4 /dev/mapper/fedora-test rw,seclabel,data=ordered
                            217 23 0:42 / /run/user/1000 rw,nosuid,nodev,relatime shared:168 - tmpfs tmpfs rw,seclabel,size=397432k,mode=700,uid=1000,gid=1000
                            225 217 0:43 / /run/user/1000/gvfs rw,nosuid,nodev,relatime shared:175 - fuse.gvfsd-fuse gvfsd-fuse rw,user_id=1000,group_id=1000
    COREDUMP_ROOT=/
    PRIORITY=2
    CODE_FILE=src/coredump/coredump.c
    SYSLOG_IDENTIFIER=lt-systemd-coredump
    _COMM=lt-systemd-core
    _SYSTEMD_CGROUP=/user.slice/user-1002.slice/user@1002.service/gnome-terminal-server.service
    _SYSTEMD_USER_UNIT=gnome-terminal-server.service
    MESSAGE_ID=1f4e0a44a88649939aaea34fc6da8c95
    CODE_FUNC=process_traceback
    COREDUMP_COMM=python3
    COREDUMP_EXE=/usr/bin/python3.5
    COREDUMP_CMDLINE=python3 systemd_coredump_exception_handler.py
    COREDUMP_CWD=/home/zbyszek/src/systemd-coredump-python
    COREDUMP_RLIMIT=-1
    COREDUMP_OPEN_FDS=0:/dev/pts/1
                      pos: 0
                      flags: 0102002
                      mnt_id: 22

                      1:/dev/pts/1
                      pos: 0
                      flags: 0102002
                      mnt_id: 22

                      2:/dev/pts/1
                      pos: 0
                      flags: 0102002
                      mnt_id: 22
    CODE_LINE=1284
    COREDUMP_SIGNAL=ZeroDivisionError: division by zero
    COREDUMP_ENVIRON=LANG=en_US.utf8
                     DISPLAY=:0
                     ...
                     MANWIDTH=90
                     LC_MESSAGES=en_US.utf8
                     PYTHONPATH=.
                     _=/usr/bin/python3
    COREDUMP_PID=14498
    COREDUMP_PROC_STATUS=Name: python3
                         Umask: 0002
                         State: S (sleeping)
                         Tgid: 14498
                         Ngid: 0
                         Pid: 14498
                         PPid: 16245
                         TracerPid: 0
                         Uid: 1002 1002 1002 1002
                         Gid: 1002 1002 1002 1002
                         FDSize: 64
                         Groups:
                         NStgid: 14498
                         NSpid: 14498
                         NSpgid: 14498
                         NSsid: 16245
                         VmPeak:    34840 kB
                         VmSize:    34792 kB
                         VmLck:        0 kB
                         VmPin:        0 kB
                         VmHWM:     9332 kB
                         VmRSS:     9332 kB
                         RssAnon:     4872 kB
                         RssFile:     4460 kB
                         RssShmem:        0 kB
                         VmData:     5012 kB
                         VmStk:      136 kB
                         VmExe:        4 kB
                         VmLib:     5452 kB
                         VmPTE:       84 kB
                         VmPMD:       12 kB
                         VmSwap:        0 kB
                         HugetlbPages:        0 kB
                         Threads: 1
                         SigQ: 0/15413
                         SigPnd: 0000000000000000
                         ShdPnd: 0000000000000000
                         SigBlk: 0000000000000000
                         SigIgn: 0000000001001000
                         SigCgt: 0000000180000002
                         CapInh: 0000000000000000
                         CapPrm: 0000000000000000
                         CapEff: 0000000000000000
                         CapBnd: 0000003fffffffff
                         CapAmb: 0000000000000000
                         Seccomp: 0
                         Cpus_allowed: f
                         Cpus_allowed_list: 0-3
                         Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
                         Mems_allowed_list: 0
                         voluntary_ctxt_switches: 2
                         nonvoluntary_ctxt_switches: 47
    COREDUMP_PROC_MAPS=55cb7b7fe000-55cb7b7ff000 r-xp 00000000 00:1a 5289186                    /usr/bin/python3.5
                       55cb7b9ff000-55cb7ba00000 r--p 00001000 00:1a 5289186                    /usr/bin/python3.5
                       55cb7ba00000-55cb7ba01000 rw-p 00002000 00:1a 5289186                    /usr/bin/python3.5
                       55cb7c007000-55cb7c189000 rw-p 00000000 00:00 0                          [heap]
                       7f4da2d51000-7f4da2d54000 r-xp 00000000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2d54000-7f4da2f53000 ---p 00003000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f53000-7f4da2f54000 r--p 00002000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f54000-7f4da2f55000 rw-p 00003000 00:1a 5279150                    /usr/lib64/python3.5/lib-dynload/resource.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f55000-7f4da2f5d000 r-xp 00000000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da2f5d000-7f4da315c000 ---p 00008000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da315c000-7f4da315d000 r--p 00007000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da315d000-7f4da315f000 rw-p 00008000 00:1a 5279143                    /usr/lib64/python3.5/lib-dynload/math.cpython-35m-x86_64-linux-gnu.so
                       7f4da315f000-7f4da319f000 rw-p 00000000 00:00 0
                       7f4da319f000-7f4da31a4000 r-xp 00000000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da31a4000-7f4da33a3000 ---p 00005000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a3000-7f4da33a4000 r--p 00004000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a4000-7f4da33a6000 rw-p 00005000 00:1a 5279151                    /usr/lib64/python3.5/lib-dynload/select.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a6000-7f4da33a9000 r-xp 00000000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da33a9000-7f4da35a8000 ---p 00003000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da35a8000-7f4da35a9000 r--p 00002000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da35a9000-7f4da35aa000 rw-p 00003000 00:1a 5279130                    /usr/lib64/python3.5/lib-dynload/_posixsubprocess.cpython-35m-x86_64-linux-gnu.so
                       7f4da35aa000-7f4da362a000 rw-p 00000000 00:00 0
                       7f4da362a000-7f4da362c000 r-xp 00000000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da362c000-7f4da382b000 ---p 00002000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da382b000-7f4da382c000 r--p 00001000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da382c000-7f4da382e000 rw-p 00002000 00:1a 5279122                    /usr/lib64/python3.5/lib-dynload/_heapq.cpython-35m-x86_64-linux-gnu.so
                       7f4da382e000-7f4da39ee000 rw-p 00000000 00:00 0
                       7f4da39ee000-7f4da3bab000 r-xp 00000000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3bab000-7f4da3daa000 ---p 001bd000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3daa000-7f4da3dae000 r--p 001bc000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3dae000-7f4da3db0000 rw-p 001c0000 00:1a 4844904                    /usr/lib64/libc-2.24.so
                       7f4da3db0000-7f4da3db4000 rw-p 00000000 00:00 0
                       7f4da3db4000-7f4da3ebc000 r-xp 00000000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da3ebc000-7f4da40bb000 ---p 00108000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da40bb000-7f4da40bc000 r--p 00107000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da40bc000-7f4da40bd000 rw-p 00108000 00:1a 4844910                    /usr/lib64/libm-2.24.so
                       7f4da40bd000-7f4da40bf000 r-xp 00000000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da40bf000-7f4da42be000 ---p 00002000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da42be000-7f4da42bf000 r--p 00001000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da42bf000-7f4da42c0000 rw-p 00002000 00:1a 4844928                    /usr/lib64/libutil-2.24.so
                       7f4da42c0000-7f4da42c3000 r-xp 00000000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da42c3000-7f4da44c2000 ---p 00003000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da44c2000-7f4da44c3000 r--p 00002000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da44c3000-7f4da44c4000 rw-p 00003000 00:1a 4844908                    /usr/lib64/libdl-2.24.so
                       7f4da44c4000-7f4da44dc000 r-xp 00000000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da44dc000-7f4da46dc000 ---p 00018000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da46dc000-7f4da46dd000 r--p 00018000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da46dd000-7f4da46de000 rw-p 00019000 00:1a 4844920                    /usr/lib64/libpthread-2.24.so
                       7f4da46de000-7f4da46e2000 rw-p 00000000 00:00 0
                       7f4da46e2000-7f4da4917000 r-xp 00000000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4917000-7f4da4b17000 ---p 00235000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4b17000-7f4da4b1c000 r--p 00235000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4b1c000-7f4da4b7f000 rw-p 0023a000 00:1a 5277535                    /usr/lib64/libpython3.5m.so.1.0
                       7f4da4b7f000-7f4da4baf000 rw-p 00000000 00:00 0
                       7f4da4baf000-7f4da4bd4000 r-xp 00000000 00:1a 4844897                    /usr/lib64/ld-2.24.so
                       7f4da4bdf000-7f4da4c10000 rw-p 00000000 00:00 0
                       7f4da4c10000-7f4da4c61000 r--p 00000000 00:1a 5225117                    /usr/lib/locale/pl_PL.utf8/LC_CTYPE
                       7f4da4c61000-7f4da4d91000 r--p 00000000 00:1a 4844827                    /usr/lib/locale/en_US.utf8/LC_COLLATE
                       7f4da4d91000-7f4da4d95000 rw-p 00000000 00:00 0
                       7f4da4dc1000-7f4da4dc2000 r--p 00000000 00:1a 4844832                    /usr/lib/locale/en_US.utf8/LC_NUMERIC
                       7f4da4dc2000-7f4da4dc3000 r--p 00000000 00:1a 4844795                    /usr/lib/locale/en_US.utf8/LC_TIME
                       7f4da4dc3000-7f4da4dc4000 r--p 00000000 00:1a 4844793                    /usr/lib/locale/en_US.utf8/LC_MONETARY
                       7f4da4dc4000-7f4da4dc5000 r--p 00000000 00:1a 4844830                    /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
                       7f4da4dc5000-7f4da4dc6000 r--p 00000000 00:1a 4844847                    /usr/lib/locale/en_US.utf8/LC_PAPER
                       7f4da4dc6000-7f4da4dc7000 r--p 00000000 00:1a 4844831                    /usr/lib/locale/en_US.utf8/LC_NAME
                       7f4da4dc7000-7f4da4dc8000 r--p 00000000 00:1a 4844790                    /usr/lib/locale/en_US.utf8/LC_ADDRESS
                       7f4da4dc8000-7f4da4dc9000 r--p 00000000 00:1a 4844794                    /usr/lib/locale/en_US.utf8/LC_TELEPHONE
                       7f4da4dc9000-7f4da4dca000 r--p 00000000 00:1a 4844792                    /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
                       7f4da4dca000-7f4da4dd1000 r--s 00000000 00:1a 4845203                    /usr/lib64/gconv/gconv-modules.cache
                       7f4da4dd1000-7f4da4dd2000 r--p 00000000 00:1a 4844791                    /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
                       7f4da4dd2000-7f4da4dd4000 rw-p 00000000 00:00 0
                       7f4da4dd4000-7f4da4dd5000 r--p 00025000 00:1a 4844897                    /usr/lib64/ld-2.24.so
                       7f4da4dd5000-7f4da4dd6000 rw-p 00026000 00:1a 4844897                    /usr/lib64/ld-2.24.so
                       7f4da4dd6000-7f4da4dd7000 rw-p 00000000 00:00 0
                       7ffd24da1000-7ffd24dc2000 rw-p 00000000 00:00 0                          [stack]
                       7ffd24de8000-7ffd24dea000 r--p 00000000 00:00 0                          [vvar]
                       7ffd24dea000-7ffd24dec000 r-xp 00000000 00:00 0                          [vdso]
                       ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
    COREDUMP_TIMESTAMP=1477877460000000
    MESSAGE=Process 14498 (python3) of user 1002 failed with ZeroDivisionError: division by zero:

            Traceback (most recent call last):
              File "systemd_coredump_exception_handler.py", line 89, in <module>
                g()
              File "systemd_coredump_exception_handler.py", line 88, in g
                f()
              File "systemd_coredump_exception_handler.py", line 86, in f
                div0 = 1 / 0  # pylint: disable=W0612
            ZeroDivisionError: division by zero

            Local variables in innermost frame:
              h=<function f at 0x7f4da3606e18>
              a=3
    _PID=14499
    _SOURCE_REALTIME_TIMESTAMP=1477877460025975

7 years agocoredump: split out metadata gathering to a separate function
Zbigniew Jędrzejewski-Szmek [Sun, 30 Oct 2016 21:37:38 +0000 (17:37 -0400)]
coredump: split out metadata gathering to a separate function

In preparation for subsequenct changes...

Various stack allocations are changed to use the heap. This might be minimally
slower, but probably doesn't matter. The upside is that we will now properly
free all memory that is allocated.

7 years agoHACKING: mkosi is now packaged for Fedora
Zbigniew Jędrzejewski-Szmek [Sun, 6 Nov 2016 02:21:17 +0000 (22:21 -0400)]
HACKING: mkosi is now packaged for Fedora

Also dnf requires sudo.

7 years agoMerge pull request #4733 from poettering/binds-to
Zbigniew Jędrzejewski-Szmek [Wed, 15 Feb 2017 04:06:50 +0000 (23:06 -0500)]
Merge pull request #4733 from poettering/binds-to

When we are about to start a unit, check the deps again.

7 years agoMerge pull request #5343 from eworm-de/virt-kvm
Djalal Harouni [Tue, 14 Feb 2017 20:45:23 +0000 (21:45 +0100)]
Merge pull request #5343 from eworm-de/virt-kvm

virt: detect qemu/kvm as 'kvm'

7 years agoMerge pull request #5346 from namhyung/coredump-reverse
Lennart Poettering [Tue, 14 Feb 2017 18:14:11 +0000 (19:14 +0100)]
Merge pull request #5346 from namhyung/coredump-reverse

Update for coredumpctl -r option

7 years agovirt: detect qemu/kvm as 'kvm'
Christian Hesse [Tue, 14 Feb 2017 13:51:12 +0000 (14:51 +0100)]
virt: detect qemu/kvm as 'kvm'

In commit 050e65a we swapped order of detect_vm_{cpuid,dmi}(). That
fixed Virtualbox but broke qemu with kvm, which is expected to return
'kvm'. So check for qemu/kvm first, then DMI, CPUID last.

This fixes #5318.

Signed-off-by: Christian Hesse <mail@eworm.de>
7 years agoshell_completion: Add -r option for coredumpctl
Namhyung Kim [Tue, 14 Feb 2017 14:08:46 +0000 (23:08 +0900)]
shell_completion: Add -r option for coredumpctl

7 years agoman: coredumpctl: Add description of -r option
Namhyung Kim [Tue, 14 Feb 2017 13:59:10 +0000 (22:59 +0900)]
man: coredumpctl: Add description of -r option

7 years agoMerge pull request #5335 from poettering/resolved-some-fixes
Lennart Poettering [Tue, 14 Feb 2017 14:09:43 +0000 (15:09 +0100)]
Merge pull request #5335 from poettering/resolved-some-fixes

some post-mdns fixes for resolved

7 years agoman: extend the docs on BindsTo= and Requires= a bit
Lennart Poettering [Tue, 29 Nov 2016 21:03:44 +0000 (22:03 +0100)]
man: extend the docs on BindsTo= and Requires= a bit

Let's emphasize that both really should be combined with After=.

7 years agocore: explicitly verify that BindsTo= deps are in order before dispatch start operati...
Lennart Poettering [Thu, 24 Nov 2016 17:47:48 +0000 (18:47 +0100)]
core: explicitly verify that BindsTo= deps are in order before dispatch start operation of a unit

Let's make sure we verify that all BindsTo= are in order before we actually go
and dispatch a start operation to a unit. Normally the job queue should already
have made sure all deps are in order, but this might not have been sufficient
in two cases: a) when the user changes deps during runtime and reloads the
daemon, and b) when the user placed BindsTo= dependencies without matching
After= dependencies, so that we don't actually wait for the bound to unit to be
up before upping also the binding unit.

See: #4725

7 years agoDefine clone order on ppc (#5325)
Zbigniew Jędrzejewski-Szmek [Tue, 14 Feb 2017 10:27:40 +0000 (05:27 -0500)]
Define clone order on ppc (#5325)

This was tested on ppc64le. Assume the same is true for ppc64.

7 years agoresolved: restore ANY reply behaviour for mDNS
Lennart Poettering [Tue, 14 Feb 2017 10:12:08 +0000 (11:12 +0100)]
resolved: restore ANY reply behaviour for mDNS

This restores behaviour of 53fda2bb933694c9bdb1bbf1f5583e39673b74b2: for
mDNS (and mDNS only) we'll match replies to transactions honouring ANY
matches.

7 years agoresolved: size the mdns announce answer array properly
Lennart Poettering [Mon, 13 Feb 2017 19:45:40 +0000 (20:45 +0100)]
resolved: size the mdns announce answer array properly

The array doesn't grow dynamically, hence pick the right size at the
moment of allocation. Let's simply multiply the number of addresses of
this link by 2, as that's how many RRs we maintain for it.

7 years agorules: add persistent by-path drm rules (#5337)
Marc-Andre Lureau [Tue, 14 Feb 2017 09:18:27 +0000 (13:18 +0400)]
rules: add persistent by-path drm rules (#5337)

Create persistent symlinks for DRM devices, ex:
/dev/dri/by-path/pci-0000:00:02.0-card -> /dev/dri/card1
/dev/dri/by-path/pci-0000:00:02.0-render -> /dev/dri/renderD129
etc...

This allows to configure DRM device usage with stable paths.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agoMerge pull request #5298 from martinpitt/relocatable-tests
Zbigniew Jędrzejewski-Szmek [Tue, 14 Feb 2017 02:13:50 +0000 (21:13 -0500)]
Merge pull request #5298 from martinpitt/relocatable-tests

test: make unit tests relocatable and add an "install-tests" make target

7 years agofstab-generator: quiesce false-positive -Werror=format-nonliteral (#5336)
Martin Pitt [Tue, 14 Feb 2017 01:58:22 +0000 (02:58 +0100)]
fstab-generator: quiesce false-positive -Werror=format-nonliteral (#5336)

Commit ae3251851 changed the fprintf() format argument into a variable
which triggers a gcc 6.3 warning/error:

  src/fstab-generator/fstab-generator.c:243:17: error: format not a string literal,
  argument types not checked [-Werror=format-nonliteral]
                 fprintf(f, format, res);

This is a false positive, as the function is only being called with
constant (not user-definable) arguments which are valid format strings.